diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2015-04-20 12:45:46 -0400 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2015-06-11 16:54:12 -0300 |
commit | 7d17269be3ff1427c63b645f50a07c012cad6e4b (patch) | |
tree | e7b4020345587754d256ef61a0c7c9451f1fe8e1 /railties/test | |
parent | e9e94c1d1540ebca77125f0f6beb6fdec2201242 (diff) | |
download | rails-7d17269be3ff1427c63b645f50a07c012cad6e4b.tar.gz rails-7d17269be3ff1427c63b645f50a07c012cad6e4b.tar.bz2 rails-7d17269be3ff1427c63b645f50a07c012cad6e4b.zip |
Add test to show api only apps allow overriding generator options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/generators_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
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 |