diff options
author | claudiob <claudiob@users.noreply.github.com> | 2018-02-12 21:48:24 -0800 |
---|---|---|
committer | claudiob <claudiob@users.noreply.github.com> | 2018-02-12 22:10:28 -0800 |
commit | b77861d0c9f9ff941e70b38a920a6084627c0713 (patch) | |
tree | c28ed970784d85a436292740154a13cc6c13a0f6 /railties/test | |
parent | b9ed1fa4442633e1328dcde5a37a472b22003a6f (diff) | |
download | rails-b77861d0c9f9ff941e70b38a920a6084627c0713.tar.gz rails-b77861d0c9f9ff941e70b38a920a6084627c0713.tar.bz2 rails-b77861d0c9f9ff941e70b38a920a6084627c0713.zip |
Don't overwrite config/master.key even on --force
See https://github.com/rails/rails/pull/31957#issuecomment-364817423
The purpose of `--force` is not to have any prompt whether a file should
be kept or overwritten. In general, all existing files should be overwritten.
However, `config/master.key` is special because it is git-ignored, and
overwriting it will cause the app not to run (since there won't be a way
to decrypt the credentials).
As a result, it's probably better to keep the existing config/master.key.
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 23e6371a79..cc4a376d31 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -653,10 +653,11 @@ class AppGeneratorTest < Rails::Generators::TestCase assert_empty output end - def test_force_option + def test_force_option_overwrites_every_file_except_master_key run_generator [File.join(destination_root, "myapp")] output = run_generator [File.join(destination_root, "myapp"), "--force"] assert_match(/force/, output) + assert_no_match("force config/master.key", output) end def test_application_name_with_spaces |