[rspec-users] Then I should be on /users/3/posts/8/comments/2/edit

Ben Mabey ben at benmabey.com
Fri Apr 10 00:56:27 EDT 2009

Gavin Hughes wrote:
> The problem is actually this:
> And I fill in ...
> And I press "Create Comment"
> Then I should be on [the correct page, ie. 
> /users/3/posts/8/comments/2/edit]
> How do you write a step for that?
I just saw this second message.. My assumption about what you were 
testing was off, but the principle remains the same.  You should verify 
that the application is correct by looking at what the user actually 
sees in the response body- not what they see in the URL/address bar.

So, instead of saying "Then I should be on..." can you say something 
like "Then I should see..."?  Again, does the user really care what the 
URL is, or what is actually on the page?


More information about the rspec-users mailing list