From 95b7b02d127d66fb7861de69a1786095e64b971f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 6 Dec 2012 17:43:36 -0200 Subject: Add test case for scaffold_controller generator without attributes. This is a test for 978c568a7bffe354180aaefa471092182fed1015 --- railties/test/generators/scaffold_controller_generator_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'railties') 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/ -- cgit v1.2.3