dblack-TKXtfPMJ4Ozk1uMJSBkQmQ@public.gmane.org
2006-Sep-29  11:12 UTC
named routes in functional tests (edge)
Hi --
I''m having trouble calling named routes in functional tests.  Given
this in routes.rb
   map_resources :tags
and this in my tags functional tests:
   def test_route
     tags_url     # just calling it
   end
I get this:
   1) Error:
test_route(TagsControllerTest):
NoMethodError: You have a nil object when you didn''t expect it!
The error occurred while evaluating nil.rewrite
    
/home/dblack/hacking/scratchpad-rest/config/../vendor/rails/actionpack/lib/action_controller/base.rb:519:in
`url_for''
     (eval):19:in `tags_url''
    
/home/dblack/hacking/scratchpad-rest/config/../vendor/rails/actionpack/lib/action_controller/test_process.rb:438:in
`method_missing''
     tags_controller_test.rb:15:in `test_route''
519 in base.rb is:
  def url_for(options = {}, *parameters_for_method_reference)
    case options
      # some when clauses...
      when Hash
        @url.rewrite(rewrite_options(options))    # 519
    end
  end
The same thing happens if I do this in the application console.
Any suggestions/ideas?
David
-- 
                   David A. Black |
dblack-TKXtfPMJ4Ozk1uMJSBkQmQ@public.gmane.org
Author of "Ruby for Rails"   [1] | Ruby/Rails training &
consultancy [3]
DABlog (DAB''s Weblog)        [2] | Co-director, Ruby Central, Inc.  
[4]
[1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com
[2] http://dablog.rubypal.com    | [4] http://www.rubycentral.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---