[rspec-users] redirect_to a relative path

David Chelimsky dchelimsky at gmail.com
Sat Jun 2 09:25:19 EDT 2007


On 6/1/07, Dylan Stamat <dylans at gmail.com> wrote:
> In a controller spec, doing something like:
> response.redirect_url.should == omglolsrofls_path
>
> ... fails, as so:
> expected "/omglolrofls", got "http://test.host/omglolrofls" (using ==)
>
> You can see that the http://test.host is prepended to the path.
> My controller is indeed redirecting to the omglolrofls path, and not
> the url.
> Is this expected ?

That's how it's doc'd
(http://rspec.rubyforge.org/rdoc-rails/classes/Spec/Rails/Matchers.html#M000014).
You can use omglolsrofls_url instead. If you think this should behave
differently, feel free to submit a feature request:
http://rubyforge.org/tracker/?group_id=797

Cheers (and welcome),
David

>
> Oh... and that's an arbitrary controller name if you were wondering ;)
> Thanks !
> ==
> Dylan
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list