~skiqqy/baal

0ab5b9acff9b4cdebcef71a0caf644163880bff2 — Stephen Cochrane 1 year, 11 months ago 6b8c198
Added new tests
1 files changed, 4 insertions(+), 1 deletions(-)

M test.sh
M test.sh => test.sh +4 -1
@@ 114,12 114,15 @@ send_mail()
{
	# Simulate a send mail request, and assert the response code
	# Usage: test MSG_JSON CODE
	run() { assert_json_code "$($clientsh "$(query_json send "$1" )")" "$2" "send mail" 2; }
	run() { assert_json_code "$($clientsh "$(query_json send "$1" )")" "$2" "Send Mail" 2; }

	# Run the tests
	$server > /dev/null 2>&1 & # Start the server
	run '{"from":"root@skiqqy.xyz", "to": "skiqqy", "msg":"Hello World"}' 0 2> /dev/null # Basic test
	run '{"from":"root@skiqqy.xyz", "to": "deavmi", "msg":"Hello World1"}' 0 2> /dev/null # Basic test
	run '{"from":"root@skiqqy.xyz", "to": "dne", "msg":"Hello World1"}' 2 2> /dev/null # Basic test
	run '{"from":"root@skiqqy.xyz", "msg":"Hello World1"}' 1 2> /dev/null # Basic test
	run '{"msg":"Hello World1"}' 1 2> /dev/null # Basic test

	kill -2 "$!"
}