From 19f6fd3672d74376109c429434ee5ed4d0494f1f Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Mon, 22 Jul 2013 21:26:21 +0200 Subject: [PATCH] Test for decrypting journals when password is saved in config --- features/data/configs/encrypted_with_pw.json | 14 ++++++++++++++ features/encryption.feature | 5 +++++ 2 files changed, 19 insertions(+) create mode 100644 features/data/configs/encrypted_with_pw.json diff --git a/features/data/configs/encrypted_with_pw.json b/features/data/configs/encrypted_with_pw.json new file mode 100644 index 00000000..1a277240 --- /dev/null +++ b/features/data/configs/encrypted_with_pw.json @@ -0,0 +1,14 @@ +{ + "default_hour": 9, + "timeformat": "%Y-%m-%d %H:%M", + "linewrap": 80, + "encrypt": true, + "editor": "", + "default_minute": 0, + "highlight": true, + "password": "bad doggie no biscuit", + "journals": { + "default": "features/journals/encrypted.journal" + }, + "tagsymbols": "@" +} diff --git a/features/encryption.feature b/features/encryption.feature index a18e2477..d134c3bb 100644 --- a/features/encryption.feature +++ b/features/encryption.feature @@ -6,6 +6,11 @@ Then we should see the message "Password" and the output should contain "2013-06-10 15:40 Life is good" + Scenario: Loading an encrypted journal with password in config + Given we use the config "encrypted_with_pw.json" + When we run "jrnl -n 1" + Then the output should contain "2013-06-10 15:40 Life is good" + Scenario: Decrypting a journal Given we use the config "encrypted.json" When we run "jrnl --decrypt" and enter "bad doggie no biscuit"