diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-09-15 14:31:02 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-09-15 14:31:02 +0900 |
commit | 8a331566bfe05ccc85f25805693aa892cec449a5 (patch) | |
tree | d21f49b5123f89eab6452b38a5272e5f237a7d62 | |
parent | 536d3068b964d5848ebc47292c21c0fb0450c17b (diff) | |
download | rails-8a331566bfe05ccc85f25805693aa892cec449a5.tar.gz rails-8a331566bfe05ccc85f25805693aa892cec449a5.tar.bz2 rails-8a331566bfe05ccc85f25805693aa892cec449a5.zip |
Add tests for credentials command
-rw-r--r-- | railties/test/commands/credentials_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/railties/test/commands/credentials_test.rb b/railties/test/commands/credentials_test.rb index fe52c306d2..743fb5f788 100644 --- a/railties/test/commands/credentials_test.rb +++ b/railties/test/commands/credentials_test.rb @@ -12,6 +12,21 @@ class Rails::Command::CredentialsCommandTest < ActiveSupport::TestCase teardown { teardown_app } + test "edit without editor gives hint" do + assert_match "No $EDITOR to open credentials in", run_edit_command(editor: "") + end + + test "edit credentials" do + # Run twice to ensure credentials can be reread after first edit pass. + 2.times do + assert_match(/access_key_id: 123/, run_edit_command) + end + end + + test "show credentials" do + assert_match(/access_key_id: 123/, run_show_command) + end + test "edit command does not add master key to gitignore when already exist" do run_edit_command @@ -27,4 +42,8 @@ class Rails::Command::CredentialsCommandTest < ActiveSupport::TestCase rails "credentials:edit" end end + + def run_show_command + rails "credentials:show" + end end |