[rspec-users] Spec'ing the result of rescue_from

PJ Kelly pj at crushlovely.com
Tue Jun 23 14:27:17 EDT 2009


Hi David, thanks for the speedy response yesterday.  Much appreciated.

On Jun 22, 3:43 pm, David Chelimsky <dchelim... at gmail.com> wrote:
> What's the failure message?

'MembersController GET process_step_2 should redirect to step_2'
FAILED
expected redirect to "http://test.host/application/step_2", got no
redirect

I did some more digging, and found a couple things.  When I try this
in the browser (by visiting /application/step_2/process) and look at
the development log, the request is actually being made to
ApplicationController#index:

Processing ApplicationController#index (for 127.0.0.1 at 2009-06-23
11:08:18) [GET]
Redirected to http://byassociation.local/application/step_2

However when the specs are run, the test log shows:

Processing MembersController#process_step_2 (for 208.77.188.166 at
2009-06-23 11:19:50) [GET]

I guess the question then, is that if this is how things are handled
when using rescue_from, how do I spec out that users are being
redirected to the right location?  Do you think the inconsistency
between the development test logs needs to be brought up with Rails
core?

Thanks in advance!

Best, PJ


More information about the rspec-users mailing list