diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2017-08-28 20:58:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-28 20:58:02 +0200 |
commit | a86ab94c3b96b3dbb491fe0799c97691465aaaaf (patch) | |
tree | a644e7f3573761610816c1ff63f706989f30bd0d | |
parent | 5c7e59a2bc7575273fb8067b7efce4af0f74affd (diff) | |
parent | ac345f5dadc31a63239e0705dcacc51ef74fdd61 (diff) | |
download | rails-a86ab94c3b96b3dbb491fe0799c97691465aaaaf.tar.gz rails-a86ab94c3b96b3dbb491fe0799c97691465aaaaf.tar.bz2 rails-a86ab94c3b96b3dbb491fe0799c97691465aaaaf.zip |
Merge pull request #30370 from yhirano55/fix_indentation_in_secrets_yaml_template
Fix indentation in the template for secrets
-rw-r--r-- | railties/lib/rails/secrets.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/encrypted_secrets_generator_test.rb | 4 | ||||
-rw-r--r-- | railties/test/secrets_test.rb | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/railties/lib/rails/secrets.rb b/railties/lib/rails/secrets.rb index 33821dd759..aea72b2d01 100644 --- a/railties/lib/rails/secrets.rb +++ b/railties/lib/rails/secrets.rb @@ -44,7 +44,7 @@ module Rails <<-end_of_template.strip_heredoc # See `secrets.yml` for tips on generating suitable keys. # production: - # external_api_key: 1466aac22e6a869134be3d09b9e89232fc2c2289 + # external_api_key: 1466aac22e6a869134be3d09b9e89232fc2c2289 end_of_template end diff --git a/railties/test/generators/encrypted_secrets_generator_test.rb b/railties/test/generators/encrypted_secrets_generator_test.rb index 205827e498..eacb5166c0 100644 --- a/railties/test/generators/encrypted_secrets_generator_test.rb +++ b/railties/test/generators/encrypted_secrets_generator_test.rb @@ -17,8 +17,8 @@ class EncryptedSecretsGeneratorTest < Rails::Generators::TestCase assert_file "config/secrets.yml.key", /\w+/ assert File.exist?("config/secrets.yml.enc") - assert_no_match(/production:\n# external_api_key: \w+/, IO.binread("config/secrets.yml.enc")) - assert_match(/production:\n# external_api_key: \w+/, Rails::Secrets.read) + assert_no_match(/# production:\n# external_api_key: \w+/, IO.binread("config/secrets.yml.enc")) + assert_match(/# production:\n# external_api_key: \w+/, Rails::Secrets.read) end def test_appends_to_gitignore diff --git a/railties/test/secrets_test.rb b/railties/test/secrets_test.rb index 445e216f16..ff6f955a78 100644 --- a/railties/test/secrets_test.rb +++ b/railties/test/secrets_test.rb @@ -47,7 +47,7 @@ class Rails::SecretsTest < ActiveSupport::TestCase ENV["RAILS_MASTER_KEY"] = IO.binread("config/secrets.yml.key").strip FileUtils.rm("config/secrets.yml.key") - assert_match "production:\n# external_api_key", Rails::Secrets.read + assert_match "# production:\n# external_api_key:", Rails::Secrets.read ensure ENV["RAILS_MASTER_KEY"] = old_key end @@ -69,7 +69,7 @@ class Rails::SecretsTest < ActiveSupport::TestCase Rails::Secrets.read_for_editing do |tmp_path| decrypted_path = tmp_path - assert_match(/production:\n# external_api_key/, File.read(tmp_path)) + assert_match(/# production:\n# external_api_key/, File.read(tmp_path)) File.write(tmp_path, "Empty streets, empty nights. The Downtown Lights.") end |