Use comma rather than semicolon to split header values (#698)
This commit is contained in:
@@ -403,7 +403,7 @@ spec = do
|
||||
_ <- post "/addresses" [json| { id: 97, address: "A Street" } |]
|
||||
p <- request methodPatch
|
||||
"/addresses?id=eq.97"
|
||||
[("Prefer", "return=representation;plurality=singular")]
|
||||
[("Prefer", "return=representation,plurality=singular")]
|
||||
[json| { address: "B Street" } |]
|
||||
liftIO $ simpleBody p `shouldBe` [str|{"id":97,"address":"B Street"}|]
|
||||
it "raises an error when attempting to update multiple entities with plurality=singular" $ do
|
||||
@@ -411,19 +411,19 @@ spec = do
|
||||
_ <- post "/addresses" [json| { id: 99, address: "yyy" } |]
|
||||
p <- request methodPatch
|
||||
"/addresses?id=gt.0"
|
||||
[("Prefer", "return=representation;plurality=singular")]
|
||||
[("Prefer", "return=representation,plurality=singular")]
|
||||
[json| { address: "zzz" } |]
|
||||
liftIO $ simpleStatus p `shouldBe` status400
|
||||
it "can provide a singular representation when creating one entity" $ do
|
||||
p <- request methodPost
|
||||
"/addresses"
|
||||
[("Prefer", "return=representation;plurality=singular")]
|
||||
[("Prefer", "return=representation,plurality=singular")]
|
||||
[json| [ { id: 100, address: "xxx" } ] |]
|
||||
liftIO $ simpleBody p `shouldBe` [str|{"id":100,"address":"xxx"}|]
|
||||
it "raises an error when attempting to create multiple entities with plurality=singular" $ do
|
||||
p <- request methodPost
|
||||
"/addresses"
|
||||
[("Prefer", "return=representation;plurality=singular")]
|
||||
[("Prefer", "return=representation,plurality=singular")]
|
||||
[json| [ { id: 100, address: "xxx" }, { id: 101, address: "xxx" } ] |]
|
||||
liftIO $ simpleStatus p `shouldBe` status400
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ spec = do
|
||||
}
|
||||
|
||||
it "can combine multiple prefer values" $
|
||||
request methodGet "/items?id=eq.5" [("Prefer","plurality=singular ; future=new; count=none")] ""
|
||||
request methodGet "/items?id=eq.5" [("Prefer","plurality=singular , future=new, count=none")] ""
|
||||
`shouldRespondWith` ResponseMatcher {
|
||||
matchBody = Just [json| {"id":5} |]
|
||||
, matchStatus = 200
|
||||
|
||||
Reference in New Issue
Block a user