From e8100fc4e306818d5b9a5d2bfd75dcf3f44553b4 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 18 Apr 2015 04:52:13 -0300 Subject: Api apps scaffold generates routes without new and edit actions --- railties/test/generators/resource_generator_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'railties/test') diff --git a/railties/test/generators/resource_generator_test.rb b/railties/test/generators/resource_generator_test.rb index 581d80d60e..f73169c6fb 100644 --- a/railties/test/generators/resource_generator_test.rb +++ b/railties/test/generators/resource_generator_test.rb @@ -85,4 +85,10 @@ class ResourceGeneratorTest < Rails::Generators::TestCase assert_no_match(/resources :accounts$/, route) end end + + def test_api_only_does_not_generate_edit_route + run_generator ["Account", "--api"] + + assert_file "config/routes.rb", /resources :accounts, except: \[:new, :edit\]$/ + end end -- cgit v1.2.3