[rspec-devel] [ rspec-Bugs-13065 ] Named routes throw a NoMethodError in Helper specs

noreply at rubyforge.org noreply at rubyforge.org
Tue Aug 14 14:55:52 EDT 2007


Bugs item #13065, was opened at 2007-08-14 18:12
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=13065&group_id=797

Category: rails plugin
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: James Deville (parcelbrat)
Assigned to: Nobody (None)
Summary: Named routes throw a NoMethodError in Helper specs

Initial Comment:
Using named routes in RSpec 1.0.8 inside of Helper specs throws a NoMethodError. 

Looking into the code some, the use of a named route like root_path is getting into the method_missing in lib/spec/matchers.rb on line 157. From there it is going to the super which is calling PrototypeHelper.method_missing in rails/actionpack/lib/action_view/helpers/prototype_helper.rb line 658, which calls a new JavaScriptProxy

That seems to be the issue. I'm going to look into why method_missing jumps straight to the JS stuff, not the named routes and such.

I'll add some patches for tests and try to fix it.



----------------------------------------------------------------------

>Comment By: James Deville (parcelbrat)
Date: 2007-08-14 18:55

Message:
Here is a diff. It may not have included the route. If not, add   "map.connect 
'custom_route', :controller => 'custom_route_spec', :action => 'custom_route'" 
to the example_rails_app routes.rb file. I don't know if I can figure out where the 
error is, any help would be appreciated, but I will try.

JD



----------------------------------------------------------------------

Comment By: James Deville (parcelbrat)
Date: 2007-08-14 18:47

Message:
This may be related to bug#13020

----------------------------------------------------------------------

Comment By: James Deville (parcelbrat)
Date: 2007-08-14 18:45

Message:
I'm running edge right now. REV: 7192. I'm working on getting a spec for it, but 
having trouble getting a named route set up to test against.

----------------------------------------------------------------------

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-08-14 18:28

Message:
Can you please mention what Rails version(s)/revision(s) you have seen this in?

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=13065&group_id=797


More information about the rspec-devel mailing list