I recently submitted http://dev.rubyonrails.org/ticket/11091 which
allows using uploaded files in integration tests.
However, although the actual code seems to work fine, the testcase I
submitted seems to be breaking non-related testcases, due to the way I
tried to set up routing for the test. Duck punching the Routeset
wasn't a good idea.
So now I'm trying to fix that but I'm having problems with the set up.
I can't seem to get my path recognized. Right now I'm trying code
Stepping through the code with rdebug, shows that the routes are
indeed set up correctly by TestProcess#with_routes at the time I do
the post, using the dump_routes method I added to Object for
debugging purposes, which is in the referenced code.
Stepping through the post shows that they are correct up to the point
where ActionController::Routing::RouteSet#recognize_path is entered at
which point it seems to have been reset back to the way the were
before the with_routes call, although I set a breakpoint in the ensure
block so I'm pretty sure that with_routes isn't doing that. As a
matter of fact, I can't see how it could.
Any advice from those more wizened in the ways of testing the rails
test infrastructure code? I suspect that this might be a problem the
route optimization logic but I haven't been able to pin it down.