mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Controller generators should use routes shortcut.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user