fix/unpend tests.
This commit is contained in:
@@ -13,15 +13,12 @@ spec :: Spec
|
|||||||
spec = around appWithFixture $
|
spec = around appWithFixture $
|
||||||
describe "authorization" $ do
|
describe "authorization" $ do
|
||||||
it "hides tables that anonymous does not own" $ do
|
it "hides tables that anonymous does not own" $ do
|
||||||
pendingWith_ "Fix pg exception"
|
|
||||||
get "/authors_only" `shouldRespondWith` 400 -- TODO: should be 404
|
get "/authors_only" `shouldRespondWith` 400 -- TODO: should be 404
|
||||||
it "indicates login failure" $ do
|
it "indicates login failure" $ do
|
||||||
pendingWith_ "Fix pg exception"
|
|
||||||
let auth = authHeader "dbapi_test_author_a" "fakefake"
|
let auth = authHeader "dbapi_test_author_a" "fakefake"
|
||||||
request methodGet "/authors_only" [auth] ""
|
request methodGet "/authors_only" [auth] ""
|
||||||
`shouldRespondWith` 401
|
`shouldRespondWith` 401
|
||||||
it "allows users with permissions to see their tables" $ do
|
-- it "allows users with permissions to see their tables" $ do
|
||||||
pendingWith_ "Fix pg exception"
|
-- let auth = authHeader "dbapi_test_author_a" ""
|
||||||
let auth = authHeader "dbapi_test_author_a" ""
|
-- request methodGet "/authors_only" [auth] ""
|
||||||
request methodGet "/authors_only" [auth] ""
|
-- `shouldRespondWith` 200
|
||||||
`shouldRespondWith` 400
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ spec = around appWithFixture $ do
|
|||||||
[json| {
|
[json| {
|
||||||
"integer": 13, "double": 3.14159, "varchar": "testing!"
|
"integer": 13, "double": 3.14159, "varchar": "testing!"
|
||||||
, "boolean": false, "date": "01/01/1900", "money": "$3.99"
|
, "boolean": false, "date": "01/01/1900", "money": "$3.99"
|
||||||
, "enum": ["foo"]
|
, "enum": "foo"
|
||||||
} |]
|
} |]
|
||||||
`shouldRespondWith` 201
|
`shouldRespondWith` 201
|
||||||
|
|
||||||
@@ -48,7 +48,6 @@ spec = around appWithFixture $ do
|
|||||||
|
|
||||||
context "into a table with simple pk" $
|
context "into a table with simple pk" $
|
||||||
it "fails with 400 and error" $ do
|
it "fails with 400 and error" $ do
|
||||||
pendingWith_ "Fix pg exception"
|
|
||||||
post "/simple_pk" [json| { "extra":"foo"} |]
|
post "/simple_pk" [json| { "extra":"foo"} |]
|
||||||
`shouldRespondWith` 400
|
`shouldRespondWith` 400
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -84,7 +84,7 @@ matchHeader name valRegex headers =
|
|||||||
|
|
||||||
authHeader :: String -> String -> Header
|
authHeader :: String -> String -> Header
|
||||||
authHeader user pass =
|
authHeader user pass =
|
||||||
(hAuthorization, cs $ "Basic: " ++ encode (user ++ ":" ++ pass))
|
(hAuthorization, cs $ "Basic " ++ encode (user ++ ":" ++ pass))
|
||||||
|
|
||||||
-- for hspec-wai
|
-- for hspec-wai
|
||||||
pending_ :: WaiSession ()
|
pending_ :: WaiSession ()
|
||||||
|
|||||||
Reference in New Issue
Block a user