Topic: Test Fails But Page Functions as Expected

I wrote a simple test to see if a controller is creating an object correctly.  I'm just testing to see that I'm redirected and that I'm redirected to the proper action.

The test fails, it says that it received a 200 status code (success) rather than the 302 (redirect).

When I fire up script/server and try to complete the action in the browser it functions exaclty as I expect.  I create the object and I am redirected to the correct action.

I'll post up the test and controller method if necessary. smile

Re: Test Fails But Page Functions as Expected

Please post the code for both the test and the controller action. It's impossible to tell what the problem is without it.

Railscasts - Free Ruby on Rails Screencasts

Re: Test Fails But Page Functions as Expected

Just for the record - I have this problem ALL THE TIME. I try really hard to do this "test driven development" but it makes me feel like I've got to get the program working in 2 different ways, when all I really care about is that the site functions correctly. Frustrating.

Re: Test Fails But Page Functions as Expected

Just for the record, every time this happens to me, it's a lurking bug and I'm glad I wrote the test. You just have to figure out why the code path to the redirect isn't being followed.