diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-06 17:43:36 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-09 16:32:54 -0300 |
commit | 95b7b02d127d66fb7861de69a1786095e64b971f (patch) | |
tree | ce40a75bd2b92b8838fdae9daeca65c0fa7650e9 /railties | |
parent | 3c2c1a46064684a1becc8ae7b6b7fe6eebf9651a (diff) | |
download | rails-95b7b02d127d66fb7861de69a1786095e64b971f.tar.gz rails-95b7b02d127d66fb7861de69a1786095e64b971f.tar.bz2 rails-95b7b02d127d66fb7861de69a1786095e64b971f.zip |
Add test case for scaffold_controller generator without attributes.
This is a test for 978c568a7bffe354180aaefa471092182fed1015
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/ |