Allow csv formatting in rpc output (#882)

This commit is contained in:
Joe Nelson
2017-05-27 00:07:23 -05:00
committed by GitHub
parent 74227d3c2b
commit 50de0536de
6 changed files with 26 additions and 10 deletions
+9
View File
@@ -487,6 +487,15 @@ spec = do
[json| [ {"id": 3}, {"id":4} ] |]
{ matchHeaders = [matchContentTypeJson] }
it "returns CSV" $
request methodPost "/rpc/getitemrange"
(acceptHdrs "text/csv")
[json| { "min": 2, "max": 4 } |]
`shouldRespondWith` "id\n3\n4"
{ matchStatus = 200
, matchHeaders = ["Content-Type" <:> "text/csv; charset=utf-8"]
}
context "unknown function" $
it "returns 404" $
post "/rpc/fakefunc" [json| {} |] `shouldRespondWith` 404