aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/commands/credentials_test.rb
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-11-30 08:01:21 +0900
committerYuji Yaginuma <yuuji.yaginuma@gmail.com>2017-11-30 10:15:45 +0900
commitf7e3c686685fb89e67293440d24356f93fa34847 (patch)
tree7cd59490462722a221493debe6e1e3388362357a /railties/test/commands/credentials_test.rb
parentd2aca50bbd69c7a12cdcbeaba3dbef2679927b90 (diff)
downloadrails-f7e3c686685fb89e67293440d24356f93fa34847.tar.gz
rails-f7e3c686685fb89e67293440d24356f93fa34847.tar.bz2
rails-f7e3c686685fb89e67293440d24356f93fa34847.zip
Do not overwrite by default if credentials already exists
Fixes #31286
Diffstat (limited to 'railties/test/commands/credentials_test.rb')
-rw-r--r--railties/test/commands/credentials_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/test/commands/credentials_test.rb b/railties/test/commands/credentials_test.rb
index 4ef827fcf1..f1bb1ef08a 100644
--- a/railties/test/commands/credentials_test.rb
+++ b/railties/test/commands/credentials_test.rb
@@ -39,6 +39,14 @@ class Rails::Command::CredentialsCommandTest < ActiveSupport::TestCase
end
end
+ test "edit command does not overwrite by default if credentials already exists" do
+ run_edit_command(editor: "eval echo api_key: abc >")
+ assert_match(/api_key: abc/, run_show_command)
+
+ run_edit_command
+ assert_match(/api_key: abc/, run_show_command)
+ end
+
private
def run_edit_command(editor: "cat")
switch_env("EDITOR", editor) do