I'm using fixture_file_upload to test some file uploads in my rspecs
If I just put it in the spec I get an error for method not found.
To get it working I put include ActionDispatch::TestProcess in my spec but I have found since I did that, that guard is not correctly reloading spec files when I make changes, it keeps running the tests against the old version of the files.
I can work around this by stopping and restarting guard, but it kind of defeats the purpose.
How do I prevent this from happening? How should I reference fixture_file_upload or where should I put the include?
ActionDispatch::TestProcess
globally (which is what happens in a factory file afaik) adds more than just thefixture_file_upload
method, and what's worse, it adds it toObject
. Some of the other methods it adds are#session
and#cookies
. Those methods will be overloaded with theActionDispatch::TestProcess
versions inside any classes which were previously defined at the time of include. This is bad news for a lot of reasons, and I suspect it causes a lot of hard-to-debug problems. – Productive