Forum: Ruby on Rails Functional Tests Fail - No URL can be generated for hash

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.
A623c85bada72e55e33ea0197386369a?d=identicon&s=25 Seth (Guest)
on 2007-06-07 20:01

I'm just learning Ruby and Rails.  I have developed a Rails application,
but not using the creation scripts that come with the rails
distribution.  Consequently, no test scaffolding is available to me, and
I'm trying to write my functional tests from scratch.

I have what might be considered a standard plain old controller
(dashboard_controller.rb) that I'm trying to test.  There are many
actions, but one in particular simply forwards to an introduction page.

Here is the code for that action:

def intro

Real simple.  Just returns and I should visit dashboard/intro.rhtml.

My unit test looks like:

require 'dashboard_controller'
require 'action_controller/test_process'
require 'action_controller/assertions'

# Raise errors beyond the default web-based presentation
class DashboardController; def rescue_action(e) raise e end; end

class DashboardControllerTest < Test::Unit::TestCase
  def setup
    @controller =
    @request =
    @response =

  # let's test our main page
  def test_intro
    get :intro
    assert_response :success


And when I run the test via the suite, I get the following error:

Loaded suite rails-app/tests/functional/suite
Finished in 0.054555 seconds.

  1) Error:
ActionController::RoutingError: No url can be generated for the hash
{:controller=>"dashboard", :action=>"intro"}
    generated_code/routing/generation.rb:5:in `generate_default_path'
    ./rails-app/tests/functional/tc_dummy_test.rb:18:in `test_intro'

1 tests, 0 assertions, 0 failures, 1 errors

I've looked at the rails code generating this error, but like I said I'm
new to this.  This error is being thrown from some autogenerated code.
I'm looking through the code generator, but I haven't been able to
figure out what I'm doing wrong.  I'm hoping this is as simple as an
omitted "requires" statement.

Any ideas?
This topic is locked and can not be replied to.