diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-03-12 19:41:17 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-03-12 19:45:01 -0300 |
commit | 7ad4c7c8814dc04a2d70967d887d2035b4d71b37 (patch) | |
tree | 8780bf9e4b4220ddf9e88bfabd9fb41250952aef /railties/test/generators | |
parent | 2ad34f46a1c4b8c59f37c2846ed0fcf3b4401e3a (diff) | |
download | rails-7ad4c7c8814dc04a2d70967d887d2035b4d71b37.tar.gz rails-7ad4c7c8814dc04a2d70967d887d2035b4d71b37.tar.bz2 rails-7ad4c7c8814dc04a2d70967d887d2035b4d71b37.zip |
Do not use the attributes hash in the scaffold functional tests
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/scaffold_controller_generator_test.rb | 3 | ||||
-rw-r--r-- | railties/test/generators/scaffold_generator_test.rb | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/railties/test/generators/scaffold_controller_generator_test.rb b/railties/test/generators/scaffold_controller_generator_test.rb index 1382133d7b..85b3a4ef61 100644 --- a/railties/test/generators/scaffold_controller_generator_test.rb +++ b/railties/test/generators/scaffold_controller_generator_test.rb @@ -75,6 +75,9 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase assert_file "test/functional/users_controller_test.rb" do |content| assert_match(/class UsersControllerTest < ActionController::TestCase/, content) assert_match(/test "should get index"/, content) + assert_match(/@valid_attributes = @user\.attributes\.slice\("age", "name"\)/, content) + assert_match(/post :create, user: @valid_attributes/, content) + assert_match(/put :update, id: @user, user: @valid_attributes/, content) end end diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb index 2db8090621..d983ae8b49 100644 --- a/railties/test/generators/scaffold_generator_test.rb +++ b/railties/test/generators/scaffold_generator_test.rb @@ -62,8 +62,12 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase end end - assert_file "test/functional/product_lines_controller_test.rb", - /class ProductLinesControllerTest < ActionController::TestCase/ + assert_file "test/functional/product_lines_controller_test.rb" do |test| + assert_match(/class ProductLinesControllerTest < ActionController::TestCase/, test) + assert_match(/@valid_attributes = @product_line\.attributes\.slice\("title"\)/, test) + assert_match(/post :create, product_line: @valid_attributes/, test) + assert_match(/put :update, id: @product_line, product_line: @valid_attributes/, test) + end # Views %w( |