[rspec-users] can't seem to test redirect?
lists at ruby-forum.com
Fri Oct 24 17:34:15 EDT 2008
Matt Wynne wrote:
> On 24 Oct 2008, at 21:57, Harry Bishop wrote:
>> Harry Bishop wrote:
>>> response.should redirect_to(@motion)
> What is this Motion? is it really something that you can redirect
> people to? Maybe you meant redirect_to(url_for(@motion))?
>> private method `split' called for #<Motion:0x2259944>.
> My guess is that this is rails / rspec-rails trying to make a URL out
> of your Motion instance. These path method errors are often rather
@motion is an instance of Motion which is the item being created
here. I used a mock or a fixture and get different results. Once saved
the redirect should take me back to the show action and render the
I tried your suggestion of url_for(@motion) and received the error:
undefined method `url_for' for
BTW - is there a way to turn off the six spec::rails::example tests?
Posted via http://www.ruby-forum.com/.
More information about the rspec-users