From e5b6188b47c811c94b7626a8ec42d946367b3c03 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 19 Apr 2015 21:17:24 -0400 Subject: [PATCH] Api apps scaffold does not generate helpers --- railties/lib/rails/generators.rb | 1 + railties/test/application/generators_test.rb | 1 + railties/test/generators/scaffold_generator_test.rb | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb index 0f99df4f57..9ff0e47aea 100644 --- a/railties/lib/rails/generators.rb +++ b/railties/lib/rails/generators.rb @@ -108,6 +108,7 @@ module Rails options[:rails].merge!( api: true, + helper: false, template_engine: nil ) end diff --git a/railties/test/application/generators_test.rb b/railties/test/application/generators_test.rb index 0cca7a50b1..6cb2bfd77b 100644 --- a/railties/test/application/generators_test.rb +++ b/railties/test/application/generators_test.rb @@ -140,6 +140,7 @@ module ApplicationTests assert Rails::Generators.hidden_namespaces.include?("js") assert Rails::Generators.hidden_namespaces.include?("css") assert Rails::Generators.options[:rails][:api] + assert_equal false, Rails::Generators.options[:rails][:helper] assert_nil Rails::Generators.options[:rails][:template_engine] end end diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb index fed2982abd..05a5c926eb 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 --no-template-engine) + run_generator %w(product_line title:string product:belongs_to user:references --api --no-template-engine --no-helper) # Model assert_file "app/models/product_line.rb", /class ProductLine < ActiveRecord::Base/ @@ -147,6 +147,9 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase %w(index show new edit _form).each do |view| assert_no_file "app/views/product_lines/#{view}.html.erb" end + + # Helpers + assert_no_file "app/helpers/product_lines_helper.rb" end def test_functional_tests_without_attributes