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.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb
index bb08b92126..fed2982abd 100644
--- a/railties/test/generators/scaffold_generator_test.rb
+++ b/railties/test/generators/scaffold_generator_test.rb
@@ -88,7 +88,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
end
def test_api_scaffold_on_invoke
- run_generator %w(product_line title:string product:belongs_to user:references --api)
+ run_generator %w(product_line title:string product:belongs_to user:references --api --no-template-engine)
# Model
assert_file "app/models/product_line.rb", /class ProductLine < ActiveRecord::Base/
@@ -140,6 +140,13 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
assert_match(/patch :update, params: \{ id: @product_line, product_line: \{ product_id: @product_line\.product_id, title: @product_line\.title, user_id: @product_line\.user_id \} \}/, test)
assert_no_match(/assert_redirected_to/, test)
end
+
+ # Views
+ assert_no_file "app/views/layouts/product_lines.html.erb"
+
+ %w(index show new edit _form).each do |view|
+ assert_no_file "app/views/product_lines/#{view}.html.erb"
+ end
end
def test_functional_tests_without_attributes