[rspec-users] RESTful Routes

Jarkko Laine jarkko at jlaine.net
Mon Feb 4 17:16:31 EST 2008

On 4.2.2008, at 19.16, Raimond Garcia wrote:
> Interesting Jarkko...
> The restful routes, seem clearer than using urls, maybe not so much
> for this case, but for very long urls, that include for example the
> title of a blog, I would rather use blog_path(@blog).
> Yes, I want to test the full stack, for sure! However, I don't see how
> using named routes, stops you from doing this....
> Webrat two thumbs up, I've been using selenium up to now, but would
> like to try other alternatives to see which one works better.

What I mean by testing the full stack is that you'd e.g. have this in  
your story:

clicks_button "Delete"

If you just use "delete some_url", there are two things that could be  

1) You have forgotten the DELETE method from your delete button.
2) The actual url in the form doesn't actually point to some_url.

Neither of the two would be caught unless you used something like  
Webrat to drill through the whole stack. If you're using blog_path in  
the story, I feel like you're using the route to test itself.


Jarkko Laine

More information about the rspec-users mailing list