title: Ruby on Rails 2.3.8: Functional Testing: assert_redirect_to not finding action?
body: <p>Here is zhe error:</p>
  
  <pre><code>NoMethodError: undefined method `dashboard_url' for #&lt;AccountsController:0x105212680 @real_format=nil&gt;
  </code></pre>
  
  <p>and here is the function which generates the error (on the assert_redirected_to :dashboard line</p>
  
  <pre><code>def login_as_owner(login = SharedTest.user.login, password = SharedTest.user.password)
    old_controller = @controller
    @controller = SessionsController.new
    post(:create, :login =&gt; login, :password =&gt; password)
    @controller = AccountsController.new 
    assert_redirected_to :dashboard
    @controller = old_controller
  
  end
  </code></pre>
  
  <p>I do controller switiching, because I need to be able to call this method from any of the functional tests, as the entire app requires being logged in first... though I'm not sure if I'm doing it right.</p>
  
  <p>I ran rake routes, and here are the related routes</p>
  
  <pre><code>               root        /                              {:controller=&gt;"accounts", :action=&gt;"dashboard"}
    dashboard_account GET    /account/dashboard(.:format)   {:controller=&gt;"accounts", :action=&gt;"dashboard"}
  </code></pre>