From 2d142eb99533557b0ed5df94b8142891942e36f0 Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison Date: Sat, 23 Oct 2021 14:22:46 -0700 Subject: [PATCH] Confirm primary config file isn't modified when encrypting/decrypting a journal in an alternate config file --- tests/bdd/features/config_file.feature | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/bdd/features/config_file.feature b/tests/bdd/features/config_file.feature index 3b3b91f5..ce4f042b 100644 --- a/tests/bdd/features/config_file.feature +++ b/tests/bdd/features/config_file.feature @@ -75,3 +75,18 @@ Feature: Multiple journals n Then we should see the message "Encrypted journal 'new_encrypted' created" + Scenario: Don't overwrite main config when encrypting a journal in an alternate config + Given the config "basic_onefile.yaml" exists + And we use the config "multiple.yaml" + When we run "jrnl --cf basic_onefile.yaml --encrypt" and enter + these three eyes + these three eyes + n + Then we should see the message "Journal encrypted to features/journals/basic_onefile.journal" + And the config should contain "encrypt: false" # multiple.yaml remains unchanged + + Scenario: Don't overwrite main config when decrypting a journal in an alternate config + Given the config "editor_encrypted.yaml" exists + And we use the config "basic_encrypted.yaml" + When we run "jrnl --cf editor_encrypted.yaml --decrypt" + Then the config should contain "encrypt: true" # basic_encrypted remains unchanged