WIP: Trap postgres errors in middleware

Fixes #39
This commit is contained in:
Joe Nelson
2014-10-08 14:58:38 -07:00
parent 68d0a38806
commit 527d51670c
5 changed files with 97 additions and 71 deletions
+2 -3
View File
@@ -13,12 +13,11 @@ spec :: Spec
spec = around appWithFixture $
describe "authorization" $ do
it "hides tables that anonymous does not own" $
-- TODO: should be 404
get "/authors_only" `shouldRespondWith` 400
get "/authors_only" `shouldRespondWith` 400 -- TODO: should be 404
it "indicates login failure" $ do
let auth = authHeader "dbapi_test_author_a" "fakefake"
request methodGet "/authors_only" [auth] ""
`shouldRespondWith` 403
`shouldRespondWith` 401
it "allows users with permissions to see their tables" $ do
let auth = authHeader "dbapi_test_author_a" ""
request methodGet "/authors_only" [auth] ""