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

I get this:

  1. Error:
    NoMethodError: You have a nil object when you didn’t expect it!
    The error occurred while evaluating nil.rewrite
    url_for' (eval):19:intags_url’
    method_missing' tags_controller_test.rb:15:intest_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

The same thing happens if I do this in the application console.

Any suggestions/ideas?


David A. Black | [email protected]
Author of “Ruby for Rails” [1] | Ruby/Rails training & consultancy [3]
DABlog (DAB’s Weblog) [2] | Co-director, Ruby Central, Inc. [4]
[1] | [3]
[2] | [4]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs