[rspec-users] Named routes problem... more rails than rspec

Jason Nah jason.nah at gmail.com
Sun Jan 30 04:48:57 EST 2011


I have emailed before about the inconsistencies I'm spotting when using
named routes/resource, but I think I've narrowed down the issue. It would
seem this has nothing to do with rspec per se, but more with how routing
works with rails.

If you have an object instance, that isn't saved and you attempt to generate
a path for that item, even though the item may have an ID, you get a "No
route matches" exception.

If the item is saved, then a valid route can be generated for that item.

Two things seem odd:

   1. The exception raised isn't very informative
   2. Why is this a constraint? And can it be turned off for testing

Is there a way around this? Or do I need to use rspec mock objects?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110130/9b8c661b/attachment.html>

More information about the rspec-users mailing list