diff options
-rw-r--r-- | railties/lib/rails/generators/rails/plugin/plugin_generator.rb | 1 | ||||
-rw-r--r-- | railties/test/generators/plugin_generator_test.rb | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb index c986066aa8..0e1326ce4f 100644 --- a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb +++ b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb @@ -89,6 +89,7 @@ task default: :test opts = (options || {}).slice(*PASSTHROUGH_OPTIONS) opts[:force] = force opts[:skip_bundle] = true + opts[:api] = options.api? invoke Rails::Generators::AppGenerator, [ File.expand_path(dummy_path, destination_root) ], opts diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index 86a776f840..2a89e2160b 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -564,6 +564,14 @@ class PluginGeneratorTest < Rails::Generators::TestCase end end + def test_dummy_api_application_for_api_plugins + run_generator [destination_root, '--api'] + + assert_file "test/dummy/config/application.rb" do |content| + assert_match "config.api_only = true", content + end + end + protected def action(*args, &block) silence(:stdout){ generator.send(*args, &block) } |