From 7d17269be3ff1427c63b645f50a07c012cad6e4b Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Mon, 20 Apr 2015 12:45:46 -0400 Subject: Add test to show api only apps allow overriding generator options --- railties/test/application/generators_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'railties/test') diff --git a/railties/test/application/generators_test.rb b/railties/test/application/generators_test.rb index ed8daa52fc..84cc6e120b 100644 --- a/railties/test/application/generators_test.rb +++ b/railties/test/application/generators_test.rb @@ -144,5 +144,21 @@ module ApplicationTests assert_equal false, Rails::Generators.options[:rails][:helper] assert_nil Rails::Generators.options[:rails][:template_engine] end + + test "api only generators allow overriding generator options" do + add_to_config <<-RUBY + config.generators.helper = true + config.api_only = true + config.generators.template_engine = :my_template + RUBY + + # Initialize the application + require "#{app_path}/config/environment" + Rails.application.load_generators + + assert Rails::Generators.options[:rails][:api] + assert Rails::Generators.options[:rails][:helper] + assert_equal :my_template, Rails::Generators.options[:rails][:template_engine] + end end end -- cgit v1.2.3