Forum: Ruby on Rails Testing routes and controller results

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
C3e347393bfc91e02e52656bbea76140?d=identicon&s=25 magic_hat (Guest)
on 2007-05-05 03:59
(Received via mailing list)
I'm trying to write a functional test that generates a route and then
follows that route to the controller and confirms that the appropriate
record is retrieved.

I'm getting some unexpected errors --- I know the route works in
development mode -- and wondering if anyone has an idea of what's
happening here. Thanks for any help you can offer.

Here's the test...

def test_show_title
    get date_url(:title=>"#{@news.srctitle}",


and the error...

NoMethodError: You have a nil object when you didn't expect it!
The error occured while evaluating nil.rewrite
actionpack-1.12.5/lib/action_controller/base.rb:488:in `url_for'
    generated/routing/named_routes/date.rb:2:in `date_url'
This topic is locked and can not be replied to.