# Functional Tests Fail - No URL can be generated for hash

**URL:** <https://www.ruby-forum.com/t/functional-tests-fail-no-url-can-be-generated-for-hash/106239>\
**Category:** Rails\
**Created:** [June 7, 2007, 8:01pm UTC](https://www.ruby-forum.com/t/functional-tests-fail-no-url-can-be-generated-for-hash/106239 "2007-06-07T20:01:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![seth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@seth](https://www.ruby-forum.com/u/seth)\
**Post date:** [June 7, 2007, 8:01pm UTC](https://www.ruby-forum.com/t/functional-tests-fail-no-url-can-be-generated-for-hash/106239/1 "2007-06-07T20:01:19Z")

</div>

Hi,

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  
end

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 = DashboardController.new  
@request = ActionController::TestRequest.new  
@response = ActionController::TestResponse.new  
end

# let’s test our main page

def test\_intro  
get :intro  
assert\_response :success  
end

end

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

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

1. Error:  
test\_intro(DashboardControllerTest):  
ActionController::RoutingError: No url can be generated for the hash  
{:controller=\>“dashboard”, :action=\>“intro”}  
generated\_code/routing/generation.rb:5:in `generate_default_path' /apollo/env/MerchantPortal/lib/ruby/site_ruby/1.8/action_controller/routing.rb:423:in`generate\_default\_path’  
/apollo/env/MerchantPortal/lib/ruby/site\_ruby/1.8/action\_controller/routing.rb:419:in  
`generate_path' /apollo/env/MerchantPortal/lib/ruby/site_ruby/1.8/action_controller/routing.rb:415:in`generate’  
/apollo/env/MerchantPortal/lib/ruby/site\_ruby/1.8/action\_controller/routing.rb:602:in  
`extra_keys' /apollo/env/MerchantPortal/lib/ruby/site_ruby/1.8/action_controller/test_process.rb:86:in`assign\_parameters’  
/apollo/env/MerchantPortal/lib/ruby/site\_ruby/1.8/action\_controller/test\_process.rb:295:in  
`process' /apollo/env/MerchantPortal/lib/ruby/site_ruby/1.8/action_controller/test_process.rb:307:in`get’  
./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?
