Fix Content-Location header when there are no params

Fixes #68
This commit is contained in:
Joe Nelson
2014-10-14 11:49:36 -07:00
parent f7751c45a2
commit f1feaecf27
2 changed files with 10 additions and 2 deletions
+9 -1
View File
@@ -36,7 +36,7 @@ spec = around appWithFixture $ do
, matchHeaders = ["Content-Range" <:> "0-1/2"]
}
describe "Canonical location" $
describe "Canonical location" $ do
it "Sets Content-Location with alphabetized params" $
get "/no_pk?b=eq.1&a=eq.1"
`shouldRespondWith` ResponseMatcher {
@@ -44,3 +44,11 @@ spec = around appWithFixture $ do
, matchStatus = 200
, matchHeaders = ["Content-Location" <:> "/no_pk?a=eq.1&b=eq.1"]
}
it "Omits question mark when there are no params" $
get "/no_pk"
`shouldRespondWith` ResponseMatcher {
matchBody = Just "[]"
, matchStatus = 200
, matchHeaders = ["Content-Location" <:> "/no_pk"]
}