aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2018-10-04 13:45:53 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2018-10-09 08:09:10 +0900
commitbd0ca39564bb2fc263c7a74a27d5f063c68b4dd8 (patch)
tree00d0daa8372764a9bc55ed58de2e8a35bb9869a1 /railties/test
parenta1ee4a9ff9d4a3cb255365310ead0dc7b739c6be (diff)
downloadrails-bd0ca39564bb2fc263c7a74a27d5f063c68b4dd8.tar.gz
rails-bd0ca39564bb2fc263c7a74a27d5f063c68b4dd8.tar.bz2
rails-bd0ca39564bb2fc263c7a74a27d5f063c68b4dd8.zip
Add `skip-webpack-install` option
This option is useful when want to check only the files generated by `rails new`, or if want to do something before `webpacker:install`.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/generators/app_generator_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index cd6bdd11c0..59fc2fcf96 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -825,6 +825,20 @@ class AppGeneratorTest < Rails::Generators::TestCase
assert_gem "webpacker"
end
+ def test_skip_webpack_install
+ command_check = -> command do
+ if command == "webpacker:install"
+ assert false, "webpacker:install expected not to be called."
+ end
+ end
+
+ generator([destination_root], skip_webpack_install: true).stub(:rails_command, command_check) do
+ quietly { generator.invoke_all }
+ end
+
+ assert_gem "webpacker"
+ end
+
def test_generator_if_skip_turbolinks_is_given
run_generator [destination_root, "--skip-turbolinks", "--no-skip-javascript"]