aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-11-08 16:57:15 +0900
committerGitHub <noreply@github.com>2017-11-08 16:57:15 +0900
commitb83df6e1a331104b18b3f005ea5b9cbb803dfe8f (patch)
tree9bbf0eb6c9d53ba5e2841d9a4656ff3a4d6df362 /railties/test/generators
parentdaf77db65d9d5e295ee3ba86605988875cb834e4 (diff)
parent8e1dca10cd98bdc8bb00592f3d90926309b22a18 (diff)
downloadrails-b83df6e1a331104b18b3f005ea5b9cbb803dfe8f.tar.gz
rails-b83df6e1a331104b18b3f005ea5b9cbb803dfe8f.tar.bz2
rails-b83df6e1a331104b18b3f005ea5b9cbb803dfe8f.zip
Merge pull request #31084 from y-yagi/do_not_run_active_storage_install_when_bundle_install_is_skipped
Do not run active storage install when bundle install is skipped
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/app_generator_test.rb16
-rw-r--r--railties/test/generators/shared_generator_tests.rb1
2 files changed, 15 insertions, 2 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"]
diff --git a/railties/test/generators/shared_generator_tests.rb b/railties/test/generators/shared_generator_tests.rb
index ed09847443..ba8ee13526 100644
--- a/railties/test/generators/shared_generator_tests.rb
+++ b/railties/test/generators/shared_generator_tests.rb
@@ -222,7 +222,6 @@ module SharedGeneratorTests
end
assert_file "#{application_path}/config/storage.yml"
- assert_directory "#{application_path}/db/migrate"
assert_directory "#{application_path}/storage"
assert_directory "#{application_path}/tmp/storage"