aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/scaffold_generator_test.rb
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2015-04-19 20:23:19 -0400
committerSantiago Pastorino <santiago@wyeworks.com>2015-06-11 16:54:12 -0300
commit6d2b405a4e4f6e076dfda11438efc5d21b1ff2a2 (patch)
tree84acb12a628a851a63c366f2399ea9fca87532a2 /railties/test/generators/scaffold_generator_test.rb
parent451b1e35746fc1f7089200ac20811080089ef192 (diff)
downloadrails-6d2b405a4e4f6e076dfda11438efc5d21b1ff2a2.tar.gz
rails-6d2b405a4e4f6e076dfda11438efc5d21b1ff2a2.tar.bz2
rails-6d2b405a4e4f6e076dfda11438efc5d21b1ff2a2.zip
Api apps scaffold does not generate views
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