diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2019-08-04 02:19:55 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2019-08-04 02:19:55 +0200 |
commit | f1f5024b918ecf303b9908f78d1a6136d9418730 (patch) | |
tree | 2e35bb48205daddbf6c5f02fdfbf8a39ffa23867 /railties/test | |
parent | 03e44f93001db97953917e0a100c627e189e2be6 (diff) | |
download | rails-f1f5024b918ecf303b9908f78d1a6136d9418730.tar.gz rails-f1f5024b918ecf303b9908f78d1a6136d9418730.tar.bz2 rails-f1f5024b918ecf303b9908f78d1a6136d9418730.zip |
Revise flow to what was described in 03e44f9
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/commands/credentials_test.rb | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/railties/test/commands/credentials_test.rb b/railties/test/commands/credentials_test.rb index e5397523e1..974b34836b 100644 --- a/railties/test/commands/credentials_test.rb +++ b/railties/test/commands/credentials_test.rb @@ -123,28 +123,24 @@ class Rails::Command::CredentialsCommandTest < ActiveSupport::TestCase end - test "diff enable diffing" do - run_diff_command(enable: true) + test "diff enroll diffing" do + assert_match("successfully enrolled", run_diff_command(enroll: true)) assert_equal <<~EOM, File.read(app_path(".gitattributes")) config/credentials/*.yml.enc diff=rails_credentials config/credentials.yml.enc diff=rails_credentials EOM + end + + test "running edit after enrolling in diffing sets diff driver" do + run_diff_command(enroll: true) + run_edit_command Dir.chdir(app_path) do assert_equal "bin/rails credentials:diff", `git config --get 'diff.rails_credentials.textconv'`.strip end end - test "diff won't enable again if already enabled" do - app_file(".git/config", <<~EOM) - [diff "rails_credentials"] - textconv = bin/rails credentials:diff - EOM - - assert_no_match(/Diffing enabled/, run_diff_command(enable: true)) - end - test "diff from git diff left file" do run_edit_command(environment: "development") @@ -196,8 +192,8 @@ class Rails::Command::CredentialsCommandTest < ActiveSupport::TestCase rails "credentials:show", args, **options end - def run_diff_command(path = nil, enable: nil, **options) - args = enable ? ["--enable"] : [path] + def run_diff_command(path = nil, enroll: nil, **options) + args = enroll ? ["--enroll"] : [path] rails "credentials:diff", args, **options end end |