You cannot do this with fixtures. Luminaires add attribute values ββdirectly to the database, skipping the active recording layer. Paperclip is an ActiveRecord plugin that processes and stores photos.
Saving a real image can only be done by passing arguments directly to a new record.
What you can do is put the attributes in the fixture so that the paper clip works as it should, without a real file.
photo_file_name: temp_file.jpg photo_content_type: image/jpeg photo_file_size: 223312 photo_updated_at: 2015-02-29 10:30:19 Z
If you want to do everything right, it is better to use FactoryGirl .
fixture_file_upload used only for action controller.
Dmitry Polushkin
source share