diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-11-08 12:15:27 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-11-08 13:24:12 +0900 |
commit | 67db41aa7f17c2d34eb5a914ac7a6b2574930ff4 (patch) | |
tree | e0c98751d15eadc90e5af611e24c22c89abe9e69 /railties/test/generators/app_generator_test.rb | |
parent | daf77db65d9d5e295ee3ba86605988875cb834e4 (diff) | |
download | rails-67db41aa7f17c2d34eb5a914ac7a6b2574930ff4.tar.gz rails-67db41aa7f17c2d34eb5a914ac7a6b2574930ff4.tar.bz2 rails-67db41aa7f17c2d34eb5a914ac7a6b2574930ff4.zip |
Do not run `active_storage:install` when bundle install is skipped
In order to execute the `rails` command, need to run bundle install in
advance.
Therefore, if skipped bundle install, `rails` command may fail and
should not do it.
Diffstat (limited to 'railties/test/generators/app_generator_test.rb')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index c5a59edab2..1de79e82e2 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -68,7 +68,6 @@ DEFAULT_APP_FILES = %w( config/spring.rb config/storage.yml db - db/migrate db/seeds.rb lib lib/tasks @@ -304,6 +303,21 @@ class AppGeneratorTest < Rails::Generators::TestCase assert_file "Gemfile", /^# gem 'mini_magick'/ end + def test_active_storage_install + command_check = -> command, _ do + @binstub_called ||= 0 + case command + when "active_storage:install" + @binstub_called += 1 + assert_equal 1, @binstub_called, "active_storage:install expected to be called once, but was called #{@install_called} times." + end + end + + generator.stub :rails_command, command_check do + quietly { generator.invoke_all } + end + end + def test_app_update_does_not_generate_active_storage_contents_when_skip_active_storage_is_given app_root = File.join(destination_root, "myapp") run_generator [app_root, "--skip-active-storage"] |