Paperclip attachments in RSpec factories
Assuming one has a model whose attachments are handled by Paperclip, i.e.
app/models/user.rb:
then to generate a test model with FactoryGirl, including the attachment:
spec/factories/user_factory.rb:
Various manipulations of the attached image through the web interface can then be tested with RSpec and Capybara.