Permalink
Browse files

Merge pull request #31279 from ttanimichi/tests-for-webpack-option

Add tests for the `--webpack` option
  • Loading branch information...
guilleiguaran committed Dec 4, 2017
2 parents 07788c7 + 915f0e6 commit c383c4142a1ce3b7bbfa241957cd81f398c91231
Showing with 14 additions and 0 deletions.
  1. +14 −0 railties/test/generators/app_generator_test.rb
@@ -743,6 +743,20 @@ def test_spring_with_dev_option
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"]

0 comments on commit c383c41

Please sign in to comment.