I have an ActionController derived Test which sends a 'post' request to the controller under test with incorrect data. The controller tries to create a new object and save it. The model has validation methods that get triggered on save and they generate a validation error detecting the incorrect data sent by test.
So far so good. Now, controller verifies that the HTTP response status is failure by using assert_response :failure. However, the test fails at this step saying:
Expected response to be a <:failure>, but was <200>
The @obj.errors is correctly populated with the validation error but somehow the HTTP response is always 200.
Any clues?