Here is zhe error:
NoMethodError: undefined method `dashboard_url' for #<AccountsController:0x105212680 @real_format=nil>
and here is the function which generates the error (on the assert_redirected_to :dashboard line
def login_as_owner(login = SharedTest.user.login, password = SharedTest.user.password)
old_controller开发者_StackOverflow社区 = @controller
@controller = SessionsController.new
post(:create, :login => login, :password => password)
@controller = AccountsController.new
assert_redirected_to :dashboard
@controller = old_controller
end
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.
I ran rake routes, and here are the related routes
root / {:controller=>"accounts", :action=>"dashboard"}
dashboard_account GET /account/dashboard(.:format) {:controller=>"accounts", :action=>"dashboard"}
try
assert_redirected_to :dashboard_account
or explicitly specifying url
assert_redirected_to '/account/dashboard'
精彩评论