New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixture_file_upload problems #385
Comments
Where is |
Okay so it looks like my project isn't loading the test_helper.rb because when I change the code to the following it will work
|
Thank you @batreyud, it works for me adding "include ActionDispatch::TestProcess". |
Thanks for solution.It helps me also for "fixture_file_upload" in Rspec model. |
Be careful, I've had some rather obscure, session related problems when I included the module. See: http://stackoverflow.com/questions/18202261/include-actiondispatchtestprocess-prevents-guard-from-reloading-properly. |
Don't include ActionDispatch::TestProcess. It has some nasty consequences. Proper solution is to use file { Rack::Test::UploadedFile.new('spec/factories/test.png', 'image/png') } |
@pjg I've been trying to use |
@josephbhunt Judging by the |
This is mostly for consistency (both styles were used before). Note: we still have to use `Rack::Test::UploadedFile.new` in factories, because of thoughtbot/factory_bot#385.
5318: specs: use `fixture_file_upload` rather than `Rack::Test::UploadedFile` r=Keirua a=kemenaran This is mostly for consistency (both styles were used before). Note: we still have to use `Rack::Test::UploadedFile.new` in factories, because of thoughtbot/factory_bot#385. Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
The other day I was having no problems running fixture_file_upload in my factory. Previously I just used a basic Factory.define but I wanted to get rid of the deprecated warnings.
So today I went to run my tests and I am getting the following errors:
The code looks like this
I have even tried putting in
spec_helper / test_helper
include ActionController::TestProcess
No luck. What am I missing?
The text was updated successfully, but these errors were encountered: