I am using RSpec (Rails 3.2) to test my controllers. I have a controller which also contains a fileupload (using CarrierWave), but I keep getting the error:
Failure/Error: "image" => fixture_file_upload(Rails.root.join('spec', 'fixtures', 'files', 'image.png'), 'image/png') RuntimeError: .../spec/fixtures/files/image.png file does not exist
In my controller I have defined the image upload like this:
def valid_attributes
{ "title" => "My own title",
"description" => "Something cool",
"image" => fixture_file_upload(Rails.root.join('spec', 'fixtures', 'files', 'image.png'), 'image/png')
}
end
I have of course checked that file exists, but might there be something else that I have overlooked?