Permalink
Browse files

Add test case for scaffold_controller generator without attributes.

This is a test for 978c568
  • Loading branch information...
1 parent 3c2c1a4 commit 95b7b02d127d66fb7861de69a1786095e64b971f @rafaelfranca rafaelfranca committed Dec 6, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 railties/test/generators/scaffold_controller_generator_test.rb
View
9 railties/test/generators/scaffold_controller_generator_test.rb
@@ -52,6 +52,15 @@ def test_controller_skeleton_is_created
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/

0 comments on commit 95b7b02

Please sign in to comment.