diff options
Diffstat (limited to 'railties/test/generators/scaffold_controller_generator_test.rb')
-rw-r--r-- | railties/test/generators/scaffold_controller_generator_test.rb | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/railties/test/generators/scaffold_controller_generator_test.rb b/railties/test/generators/scaffold_controller_generator_test.rb index ab00586a64..bd99e78644 100644 --- a/railties/test/generators/scaffold_controller_generator_test.rb +++ b/railties/test/generators/scaffold_controller_generator_test.rb @@ -31,12 +31,10 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase assert_instance_method :create, content do |m| assert_match(/@user = User\.new\(user_params\)/, m) assert_match(/@user\.save/, m) - assert_match(/@user\.errors/, m) end assert_instance_method :update, content do |m| assert_match(/@user\.update\(user_params\)/, m) - assert_match(/@user\.errors/, m) end assert_instance_method :destroy, content do |m| @@ -127,18 +125,6 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase assert_no_file "app/views/layouts/users.html.erb" end - def test_skip_html_if_required - run_generator [ "User", "name:string", "age:integer", "--no-html" ] - assert_no_file "app/helpers/users_helper.rb" - assert_no_file "app/views/users" - - assert_file "app/controllers/users_controller.rb" do |content| - assert_no_match(/format\.html/, content) - assert_no_match(/def edit/, content) - assert_no_match(/def new/, content) - end - end - def test_default_orm_is_used run_generator ["User", "--orm=unknown"] @@ -176,7 +162,7 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase def test_new_hash_style run_generator assert_file "app/controllers/users_controller.rb" do |content| - assert_match(/\{ render action: "new" \}/, content) + assert_match(/render action: "new"/, content) end end end |