aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/scaffold_generator_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/generators/scaffold_generator_test.rb')
-rw-r--r--railties/test/generators/scaffold_generator_test.rb17
1 files changed, 4 insertions, 13 deletions
diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb
index f3f2c170ee..357f472a3f 100644
--- a/railties/test/generators/scaffold_generator_test.rb
+++ b/railties/test/generators/scaffold_generator_test.rb
@@ -41,12 +41,10 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
assert_instance_method :create, content do |m|
assert_match(/@product_line = ProductLine\.new\(product_line_params\)/, m)
assert_match(/@product_line\.save/, m)
- assert_match(/@product_line\.errors/, m)
end
assert_instance_method :update, content do |m|
- assert_match(/@product_line\.update_attributes\(product_line_params\)/, m)
- assert_match(/@product_line\.errors/, m)
+ assert_match(/@product_line\.update\(product_line_params\)/, m)
end
assert_instance_method :destroy, content do |m|
@@ -61,7 +59,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
assert_file "test/controllers/product_lines_controller_test.rb" do |test|
assert_match(/class ProductLinesControllerTest < ActionController::TestCase/, test)
assert_match(/post :create, product_line: \{ product_id: @product_line\.product_id, title: @product_line\.title, user_id: @product_line\.user_id \}/, test)
- assert_match(/put :update, id: @product_line, product_line: \{ product_id: @product_line\.product_id, title: @product_line\.title, user_id: @product_line\.user_id \}/, test)
+ assert_match(/patch :update, id: @product_line, product_line: \{ product_id: @product_line\.product_id, title: @product_line\.title, user_id: @product_line\.user_id \}/, test)
end
# Views
@@ -87,7 +85,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
assert_match(/class ProductLinesControllerTest < ActionController::TestCase/, content)
assert_match(/test "should get index"/, content)
assert_match(/post :create, product_line: \{ \}/, content)
- assert_match(/put :update, id: @product_line, product_line: \{ \}/, content)
+ assert_match(/patch :update, id: @product_line, product_line: \{ \}/, content)
end
end
@@ -158,12 +156,10 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
assert_instance_method :create, content do |m|
assert_match(/@admin_role = Admin::Role\.new\(admin_role_params\)/, m)
assert_match(/@admin_role\.save/, m)
- assert_match(/@admin_role\.errors/, m)
end
assert_instance_method :update, content do |m|
- assert_match(/@admin_role\.update_attributes\(admin_role_params\)/, m)
- assert_match(/@admin_role\.errors/, m)
+ assert_match(/@admin_role\.update\(admin_role_params\)/, m)
end
assert_instance_method :destroy, content do |m|
@@ -257,11 +253,6 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
assert_no_file "app/assets/stylesheets/posts.css"
end
- def test_scaffold_generator_no_html
- run_generator [ "posts", "--no-html" ]
- assert_no_file "app/assets/stylesheets/scaffold.css"
- end
-
def test_scaffold_generator_no_javascripts
run_generator [ "posts", "--no-javascripts" ]
assert_file "app/assets/stylesheets/scaffold.css"