From fd237b33b10a4ece774dfec07ed941995fe476b3 Mon Sep 17 00:00:00 2001 From: "Adam C. Baker" Date: Mon, 13 Oct 2014 16:54:21 -0700 Subject: [PATCH] fix/unpend tests. --- test/Feature/AuthSpec.hs | 11 ++++------- test/Feature/InsertSpec.hs | 3 +-- test/SpecHelper.hs | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/test/Feature/AuthSpec.hs b/test/Feature/AuthSpec.hs index 04222aa87..cd657a4ac 100644 --- a/test/Feature/AuthSpec.hs +++ b/test/Feature/AuthSpec.hs @@ -13,15 +13,12 @@ spec :: Spec spec = around appWithFixture $ describe "authorization" $ do it "hides tables that anonymous does not own" $ do - pendingWith_ "Fix pg exception" get "/authors_only" `shouldRespondWith` 400 -- TODO: should be 404 it "indicates login failure" $ do - pendingWith_ "Fix pg exception" let auth = authHeader "dbapi_test_author_a" "fakefake" request methodGet "/authors_only" [auth] "" `shouldRespondWith` 401 - it "allows users with permissions to see their tables" $ do - pendingWith_ "Fix pg exception" - let auth = authHeader "dbapi_test_author_a" "" - request methodGet "/authors_only" [auth] "" - `shouldRespondWith` 400 + -- it "allows users with permissions to see their tables" $ do + -- let auth = authHeader "dbapi_test_author_a" "" + -- request methodGet "/authors_only" [auth] "" + -- `shouldRespondWith` 200 diff --git a/test/Feature/InsertSpec.hs b/test/Feature/InsertSpec.hs index 34b945177..bbc06c29f 100644 --- a/test/Feature/InsertSpec.hs +++ b/test/Feature/InsertSpec.hs @@ -27,7 +27,7 @@ spec = around appWithFixture $ do [json| { "integer": 13, "double": 3.14159, "varchar": "testing!" , "boolean": false, "date": "01/01/1900", "money": "$3.99" - , "enum": ["foo"] + , "enum": "foo" } |] `shouldRespondWith` 201 @@ -48,7 +48,6 @@ spec = around appWithFixture $ do context "into a table with simple pk" $ it "fails with 400 and error" $ do - pendingWith_ "Fix pg exception" post "/simple_pk" [json| { "extra":"foo"} |] `shouldRespondWith` 400 diff --git a/test/SpecHelper.hs b/test/SpecHelper.hs index b57c4c25e..9cd0f08ae 100644 --- a/test/SpecHelper.hs +++ b/test/SpecHelper.hs @@ -84,7 +84,7 @@ matchHeader name valRegex headers = authHeader :: String -> String -> Header authHeader user pass = - (hAuthorization, cs $ "Basic: " ++ encode (user ++ ":" ++ pass)) + (hAuthorization, cs $ "Basic " ++ encode (user ++ ":" ++ pass)) -- for hspec-wai pending_ :: WaiSession ()