diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/generators/scaffold_controller_generator_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/railties/test/generators/scaffold_controller_generator_test.rb b/railties/test/generators/scaffold_controller_generator_test.rb index 2a88dac635..0498c4c3fd 100644 --- a/railties/test/generators/scaffold_controller_generator_test.rb +++ b/railties/test/generators/scaffold_controller_generator_test.rb @@ -52,6 +52,15 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase end end + def test_dont_use_require_or_permit_if_there_are_no_attributes + run_generator ["User"] + + assert_file "app/controllers/users_controller.rb" do |content| + assert_match(/def user_params/, content) + assert_match(/params\[:user\]/, content) + end + end + def test_helper_are_invoked_with_a_pluralized_name run_generator assert_file "app/helpers/users_helper.rb", /module UsersHelper/ |