提交 ac345f5d 编写于 作者: Y Yoshiyuki Hirano

Fix indentation in the template for secrets

上级 3580edc9
......@@ -44,7 +44,7 @@ def template
<<-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
......
......@@ -17,8 +17,8 @@ def test_generates_key_file_and_encrypted_secrets_file
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
......
......@@ -47,7 +47,7 @@ def teardown
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 @@ def teardown
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册