when set a named route in config/routes.rb
G0::Application.routes.draw do |map|
resources :users match 'my/login' =>
'user#login'
.....
end
use:rake routes ,there was show route is there:
GET /my/login {:controller=>"user", :action=>"login
"}
but when launch server, go to http://localhost:3000/my/login
it will tell you :
No route matches "/my/login"
then I use function test in users_controller_test.rb
1) Error:
test_should_route_to_user_login(UsersControllerTest):
ActionController::RoutingError: No route matches
"/my/login"
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0.beta/lib/action_dispatch
/routing/route_set.rb:441:in recognize_path'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0.beta/lib/action_dispatch
/testing/assertions/routing.rb:177:in
recognized_request_for'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0.beta/lib/action_dispatch
/testing/assertions/routing.rb:49:in
assert_recognizes'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0.beta/lib/action_dispatch
/testing/assertions/routing.rb:117:in
assert_routing'
test/functional/users_controller_test.rb:53:in `block in <class:UsersControl
lerTest>'
I use windows/netbeans development env, and not an experts on
rails, not sure whether is really bug ?
Brs
Hunter