From 6d2b405a4e4f6e076dfda11438efc5d21b1ff2a2 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 19 Apr 2015 20:23:19 -0400 Subject: Api apps scaffold does not generate views --- railties/test/generators/scaffold_generator_test.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'railties/test/generators/scaffold_generator_test.rb') 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 -- cgit v1.2.3