diff --git a/test/recipients.bats b/test/recipients.bats index 6c73759..433d46a 100644 --- a/test/recipients.bats +++ b/test/recipients.bats @@ -134,6 +134,9 @@ make_second_identity() { init_with_remote create_project_dir myproj run "$SECRETS_BIN" push + # Simulate a legacy store (no recipients.txt) so recipients add triggers the + # bootstrap branch (if [ ! -e "$RECIPIENTS_FILE" ]) rather than the append path. + rm -f "$SECRETS_DIR/recipients.txt" make_second_identity run "$SECRETS_BIN" recipients add "$BOB_PUB" --name bob [ "$status" -eq 0 ] @@ -255,3 +258,12 @@ make_second_identity() { [[ "$output" == *"recipients: 2"* ]] || false [[ "$output" == *"bob"* ]] || false } + +@test "which reports single-key for a legacy store" { + init_with_remote + rm -f "$SECRETS_DIR/recipients.txt" + create_project_dir myproj + run "$SECRETS_BIN" which + [ "$status" -eq 0 ] + [[ "$output" == *"recipients: single-key"* ]] || false +}