From 5ab40f2b50c280da1542fe407c132225613a83e5 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 2 Aug 2020 18:38:36 -0700 Subject: [PATCH] basic send_message test --- server/tests/verify_basic_cases.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/server/tests/verify_basic_cases.sh b/server/tests/verify_basic_cases.sh index 1eda5da..b23e796 100644 --- a/server/tests/verify_basic_cases.sh +++ b/server/tests/verify_basic_cases.sh @@ -2,7 +2,9 @@ # Available tests marked with `TEST` - ez grep usage -active_tests='list_all_channels create_channel delete_channel' +active_tests='list_all_channels create_channel delete_channel +send_message +' list_all_channels() { # TEST result=$(curl --silent -i $GET $url/channels/list -d $simple_key) @@ -25,11 +27,11 @@ delete_channel() { } send_message() { - # creating a bs channel, we don't care about this operation - # as long as the other test passes this should be fine - $crl $POST $url/channel/create -d '{"secret":"secret","name":"msgchannel"}' + # ignoring the reaction to this as its not _completely_ relevant for this test + $crl $POST $url/channels/create -d '{"secret":"secret","name":"msgchannel","kind":2}' > /dev/null - kv='{"secret":"secret", "content":"message sample", "channel":123}' + # now we can try sending the right parameters to send a basic message + kv='{"secret":"secret", "content":"message sample", "channel":"msgchannel"}' result=$($crl $POST $url/message/send -d "$kv") code=$(echo "$result" | grep HTTP\/1.1 | awk '{print $2}') # non-existant channel for now but whatever ignore for now