Update hspec-wai to 0.8.0 (#799)

This commit is contained in:
Diogo Biazus
2017-02-14 21:18:01 -08:00
committed by Joe Nelson
parent 98438c437f
commit 728e40c96c
14 changed files with 229 additions and 290 deletions
+8 -13
View File
@@ -86,16 +86,14 @@ spec =
request methodPost "/addresses"
[("Prefer", "return=minimal"), singular]
[json| [ { id: 101, address: "xxx" } ] |]
`shouldRespondWith` ResponseMatcher {
matchBody = Just ""
, matchStatus = 201
`shouldRespondWith` ""
{ matchStatus = 201
, matchHeaders = ["Content-Range" <:> "*/*"]
}
-- and the element should exist
get "/addresses?id=eq.101"
`shouldRespondWith` ResponseMatcher {
matchBody = Just [str|[{"id":101,"address":"xxx"}]|]
, matchStatus = 200
`shouldRespondWith` [str|[{"id":101,"address":"xxx"}]|]
{ matchStatus = 200
, matchHeaders = []
}
@@ -113,9 +111,8 @@ spec =
request methodPost "/addresses"
[("Prefer", "return=minimal"), singular]
[json| [ { id: 200, address: "xxx" }, { id: 201, address: "yyy" } ] |]
`shouldRespondWith` ResponseMatcher {
matchBody = Just ""
, matchStatus = 201
`shouldRespondWith` ""
{ matchStatus = 201
, matchHeaders = ["Content-Range" <:> "*/*"]
}
@@ -142,11 +139,9 @@ spec =
[("Prefer", "return=representation"), singular] ""
`shouldRespondWith` 406
-- the rows should not exist, either
get firstItems
`shouldRespondWith` ResponseMatcher {
matchBody = Nothing
, matchStatus = 200
`shouldRespondWith` [json| [{"id":1},{"id":2},{"id":3},{"id":4},{"id":5},{"id":6},{"id":7},{"id":8},{"id":9},{"id":10}] |]
{ matchStatus = 200
, matchHeaders = ["Content-Range" <:> "0-9/*"]
}