[rspec-users] Problem verifying routing error

Randy Harmon r_j_h_box-sf at yahoo.com
Mon May 11 00:33:32 EDT 2009

Thanks, Ben.

>> NoMethodError in 'ItemsController route generation should NOT map
>> #indewfefwex'
>> You have a nil object when you didn't expect it!
>> You might have expected an instance of Array.
>> The error occurred while evaluating nil.first
>> /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/assertions/routing_assertions.rb:134:in
>> `recognized_request_for'

[reordered] Ben Mabey:
> Hmm.. yeah, it seems like it might have to do with how the exceptions
> are being handled in the newer version of rspec-rials (see
> https://rspec.lighthouseapp.com/projects/5645/tickets/85-11818-have-mode-for-rails-error-handling). 

Right, the bypass_rescue() method.  Just to clarify:

>> I tried using bypass_rescue in my routing/items_routing_spec.rb file as
>> mentioned by the upgrade doc, but it wasn't valid in the "routing" spec
>> - worked fine when I moved the file back to spec/controllers/, though.

"worked fine", by which I mean "didn't have a problem with me calling
it" - but didn't provide any exception for me to catch.

> I don't use RSpec to verify my routes very often and have never used it
> to verify the non-existence of a route so I'm afraid I don't really have
> any ideas...

Maybe I'm out of my tree a bit to want it.  I guess I don't really care
to validate has_many relationships, why should it matter to validate
:except rules?  Should I adjust my thinking on this one?



More information about the rspec-users mailing list