Implements CSV resnponse for the appropriate accept headers
This commit is contained in:
@@ -3,6 +3,7 @@ module Feature.QuerySpec where
|
||||
import Test.Hspec
|
||||
import Test.Hspec.Wai
|
||||
import Test.Hspec.Wai.JSON
|
||||
import Network.HTTP.Types
|
||||
import Network.Wai.Test (SResponse(simpleHeaders))
|
||||
|
||||
import SpecHelper
|
||||
@@ -121,6 +122,12 @@ spec =
|
||||
it "without other constraints" $
|
||||
get "/items?order=asc.id" `shouldRespondWith` 200
|
||||
|
||||
describe "Accept headers" $
|
||||
it "should respond with CSV to 'text/csv' request" $
|
||||
request methodGet "/simple_pk"
|
||||
(acceptHdrs "text/csv") ""
|
||||
`shouldRespondWith` "k,extra\rxyyx,u\rxYYx,v"
|
||||
|
||||
describe "Canonical location" $ do
|
||||
it "Sets Content-Location with alphabetized params" $
|
||||
get "/no_pk?b=eq.1&a=eq.1"
|
||||
|
||||
Reference in New Issue
Block a user