aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRobin Dupret <robin.dupret@gmail.com>2015-07-23 18:01:53 +0200
committerRobin Dupret <robin.dupret@gmail.com>2015-07-23 18:27:19 +0200
commitce32c9da962a9dd7a894c9a4457db9dd5f5a5a1f (patch)
treee6627c8ebf91c55fce74fc5e803bdf7a22fb6389 /railties
parente3cfd5b174f37146b81026c0d1856b672bd6bbec (diff)
downloadrails-ce32c9da962a9dd7a894c9a4457db9dd5f5a5a1f.tar.gz
rails-ce32c9da962a9dd7a894c9a4457db9dd5f5a5a1f.tar.bz2
rails-ce32c9da962a9dd7a894c9a4457db9dd5f5a5a1f.zip
Generate an API dummy application for API plugins
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/rails/plugin/plugin_generator.rb1
-rw-r--r--railties/test/generators/plugin_generator_test.rb8
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) }