[rspec-users] Testing only for a redirect

David Chelimsky dchelimsky at gmail.com
Fri Jun 25 15:18:10 EDT 2010


On Fri, Jun 25, 2010 at 1:56 PM, Marcelo de Moraes Serpa
<celoserpa at gmail.com> wrote:
> Hello guys,
>
> Quick question: How could I just test if a redirect was made, without URL
> whatsoever?

In rspec-1/rails-2:

response.should be_redirect

This is not in rspec-rails-2 yet, so you can just go with the rails
assertion for now:

assert_response :redirect

HTH,
David


More information about the rspec-users mailing list