Accept order query param

Fixes #66
This commit is contained in:
Joe Nelson
2014-10-13 22:29:28 -07:00
parent 901df91d6c
commit fbb13f4ab3
3 changed files with 55 additions and 3 deletions
+16
View File
@@ -20,6 +20,22 @@ spec = around appWithFixture $ do
, matchHeaders = ["Content-Range" <:> "0-0/1"]
}
describe "ordering response" $ do
it "by a column asc" $
get "/items?id=lte.2&order=asc.id"
`shouldRespondWith` ResponseMatcher {
matchBody = Just "[{\"id\":1},{\"id\":2}]"
, matchStatus = 200
, matchHeaders = ["Content-Range" <:> "0-1/2"]
}
it "by a column desc" $
get "/items?id=lte.2&order=desc.id"
`shouldRespondWith` ResponseMatcher {
matchBody = Just "[{\"id\":2},{\"id\":1}]"
, matchStatus = 200
, matchHeaders = ["Content-Range" <:> "0-1/2"]
}
describe "Canonical location" $
it "Sets Content-Location with alphabetized params" $
get "/no_pk?b=eq.1&a=eq.1"