Controller generators should use routes shortcut.

This commit is contained in:
José Valim
2010-03-22 21:06:03 +01:00
parent 4998e097cc
commit e8a80cdded
2 changed files with 2 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ module Rails
def add_routes
actions.reverse.each do |action|
route %{get "/#{file_name}/#{action}" => "#{file_name}##{action}"}
route %{get "#{file_name}/#{action}"}
end
end

View File

@@ -55,7 +55,7 @@ class ControllerGeneratorTest < Rails::Generators::TestCase
def test_add_routes
run_generator
assert_file "config/routes.rb", /get "\/account\/foo" => "account#foo"/, /get "\/account\/bar" => "account#bar"/
assert_file "config/routes.rb", /get "account\/foo"/, /get "account\/bar"/
end
def test_invokes_default_template_engine_even_with_no_action