Skip to content

Commit

Permalink
treehouses feedback error code (fixes #2175) (#2176)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
JLKwong and dogi authored Apr 15, 2021
1 parent cd0672f commit efa3e19
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/feedback.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function feedback {
curl -s -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer $token" "$channel" -d "$body"> "$LOGFILE"
echo "Thanks for the feedback!"
else
echo "No feedback was submitted."
log_and_exit1 "No feedback was submitted."
fi
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@treehouses/cli",
"version": "1.25.38",
"version": "1.25.39",
"remote": "4000",
"description": "Thin command-line interface for Raspberry Pi low level configuration.",
"main": "cli.sh",
Expand Down
13 changes: 9 additions & 4 deletions tests/feedback.bats
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/usr/bin/env bats
load test-helper

@test "$clinom feedback" {
run "${clicmd}" feedback cli-tests
assert_success
}
@test "$clinom feedback (no feedback)" {
run "${clicmd}" feedback
assert_failure && assert_output --partial 'No feedback was submitted.'
}

@test "$clinom feedback foo (with feedback)" {
run "${clicmd}" feedback "test from tests/feedback.bats"
assert_output --partial 'Thanks for the feedback!'
}

0 comments on commit efa3e19

Please sign in to comment.