everydayrails / rails-4-1-rspec-3-0

Code samples for Everyday Rails Testing with RSpec, Rails 4.1/RSpec 3.0 edition
272 stars 229 forks source link

Ch 10: Use string instead of File object for attach_file #30

Closed JunichiIto closed 9 years ago

JunichiIto commented 10 years ago

In chapter 10, you wrote attach_file 'Avatar', File.new(...) but that did not work for me. I used string file path instead of File object, like this:

https://github.com/JunichiIto/instance-variable-sandbox/blob/master/spec/features/csv_uploads_spec.rb#L18

Could you check it please?

ruralocity commented 9 years ago

You're right. I think FactoryGirl expects a File object, but Capybara wants a string. I've updated this in the book for the next release.