Add async/sync test to check that a bad HTTP verb is rejected

This commit is contained in:
Scott Walker 2016-02-04 11:07:07 +00:00
parent e71c5b8434
commit 41836a72ad
2 changed files with 11 additions and 1 deletions

View file

@ -105,10 +105,15 @@
(let [response (common/patch client "http://localhost:10000/hello/")]
(is (= 200 (:status @response)))
(is (= "Hello, World!" (slurp (:body @response))))))
(testing "GET request via request function with persistent async client"
(testing "GET request via request function with persistent async client"
(let [response (common/make-request client "http://localhost:10000/hello/" :get)]
(is (= 200 (:status @response)))
(is (= "Hello, World!" (slurp (:body @response))))))
(testing "Bad verb request via request function with persistent async client"
(is (thrown? IllegalArgumentException
(common/make-request client
"http://localhost:10000/hello/"
:bad))))
(testing "client closes properly"
(common/close client)
(is (thrown? IllegalStateException

View file

@ -166,6 +166,11 @@
(let [response (common/make-request client "http://localhost:10000/hello/" :get)]
(is (= 200 (:status response)))
(is (= "Hello, World!" (slurp (:body response))))))
(testing "Bad verb request via request function with persistent sync client"
(is (thrown? IllegalArgumentException
(common/make-request client
"http://localhost:10000/hello/"
:bad))))
(testing "client closes properly"
(common/close client)
(is (thrown? IllegalStateException