diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2017-12-04 10:37:54 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-04 10:37:54 -0500 |
commit | c383c4142a1ce3b7bbfa241957cd81f398c91231 (patch) | |
tree | e5a527ffe349600b8fdd333580daf69a134374df /railties/test/generators | |
parent | 07788c7ad8bad797ec97cba038e37e007f343afa (diff) | |
parent | 915f0e682cecf80080914d0390ce22eb06f41470 (diff) | |
download | rails-c383c4142a1ce3b7bbfa241957cd81f398c91231.tar.gz rails-c383c4142a1ce3b7bbfa241957cd81f398c91231.tar.bz2 rails-c383c4142a1ce3b7bbfa241957cd81f398c91231.zip |
Merge pull request #31279 from ttanimichi/tests-for-webpack-option
Add tests for the `--webpack` option
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 14 |
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 8d12f4e5a7..decea77d48 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -743,6 +743,20 @@ class AppGeneratorTest < Rails::Generators::TestCase end end + def test_webpack_option + command_check = -> command, *_ do + @called ||= 0 + @called += 1 if command == "webpacker:install" + assert_equal 1, @called, "webpacker:install expected to be called once, but was called #{@called} times." + end + + generator([destination_root], webpack: 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"] |