Skip to content

Commit

Permalink
Merge pull request #27 from jloh/slack_tests
Browse files Browse the repository at this point in the history
Add in unit tests for slack help command
  • Loading branch information
jloh authored Mar 30, 2018
2 parents c7e8c5b + af1e7d1 commit c02e5f4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions t/v1/hooks/03-slack.t
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,23 @@ Content-type: application/x-www-form-urlencoded
[error]
--- response_body
{"attachments":[{"text":"Hmmm. Looks like you've given us a bad IP (`google.com`). This command only accepts IPs (IPv6 or IPv4) for now, sorry!","mrkdwn_in":["text"],"fallback":"Hmmm. Looks like you've given us a bad IP. This command only accepts IPs (IPv6 or IPv4) for now, sorry!","color":"danger"}]}
=== TEST 4: Help command
--- http_config eval
"$::HttpConfig"
--- config
include "../../../conf/v1/hooks.conf";
set $geojs_slack_token '1234';
set $geojs_dns_server '8.8.8.8';
--- more_headers
Content-type: application/x-www-form-urlencoded
--- request eval
"POST /v1/hooks/slack
".CORE::join("&",
"token=1234",
"text=help",
"command=geojs")
--- no_error_log
[error]
--- response_body
{"text":"Having some trouble? The GeoJS slack app can be used like so `\/geojs 8.8.8.8`. Give it a try!\nIf you continue to have trouble reach out to us at [email protected]"}

0 comments on commit c02e5f4

Please sign in to comment.