From 6c1233fcecc5287f36bce9f259397a619c213eb6 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Thu, 20 Aug 2015 15:15:53 -0400 Subject: [PATCH 1/3] Adss stack-work directory to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 627f059de..3e3525da0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ cabal.sandbox.config hscope.out codex.tags .anvil +.stack-work From f9d50018d9f70dcd152462b1ab70a65930807a16 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Thu, 20 Aug 2015 15:16:25 -0400 Subject: [PATCH 2/3] Rollback to aeson 0.8.0.2 to allow building with stackage, and adds stack.yml --- postgrest.cabal | 4 ++-- stack.yaml | 7 +++++++ test/Feature/InsertSpec.hs | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 stack.yaml diff --git a/postgrest.cabal b/postgrest.cabal index 055c7dff0..992e33eb6 100644 --- a/postgrest.cabal +++ b/postgrest.cabal @@ -36,7 +36,7 @@ executable postgrest , HTTP, convertible, http-types , case-insensitive , scientific, time - , aeson, network >= 2.6 + , aeson == 0.8.0.*, network >= 2.6 , bytestring, text, split, string-conversions , stringsearch , containers, unordered-containers @@ -118,7 +118,7 @@ Test-Suite spec , Spec , SpecHelper Build-Depends: base, hspec == 2.1.*, QuickCheck - , hspec-wai == 0.5.*, hspec-wai-json + , hspec-wai, hspec-wai-json , hasql, hasql-backend , hasql-postgres , warp, wai diff --git a/stack.yaml b/stack.yaml new file mode 100644 index 000000000..9d8d9f3e1 --- /dev/null +++ b/stack.yaml @@ -0,0 +1,7 @@ +flags: {} +packages: +- '.' +extra-deps: + - Ranged-sets-0.3.0 + - packdeps-0.4.1 +resolver: lts-3.1 diff --git a/test/Feature/InsertSpec.hs b/test/Feature/InsertSpec.hs index d047e70a9..ea6badbb2 100644 --- a/test/Feature/InsertSpec.hs +++ b/test/Feature/InsertSpec.hs @@ -89,7 +89,7 @@ spec = afterAll_ resetDb $ around withApp $ do it "fails with 400 and error" $ post "/simple_pk" "}{ x = 2" `shouldRespondWith` ResponseMatcher { - matchBody = Just [json| {"message":"Failed to parse JSON payload. Failed reading: not a valid json value"} |] + matchBody = Just [json| {"message":"Failed to parse JSON payload. Failed reading: satisfy"} |] , matchStatus = 400 , matchHeaders = [] } From c34f96ce2e8c38fa93e8c583d599ebbc9e6d7939 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Thu, 20 Aug 2015 16:40:31 -0400 Subject: [PATCH 3/3] Removes body matcher to compile and test against any aeson version >= 0.8 --- postgrest.cabal | 2 +- test/Feature/InsertSpec.hs | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/postgrest.cabal b/postgrest.cabal index 992e33eb6..5ac62f842 100644 --- a/postgrest.cabal +++ b/postgrest.cabal @@ -36,7 +36,7 @@ executable postgrest , HTTP, convertible, http-types , case-insensitive , scientific, time - , aeson == 0.8.0.*, network >= 2.6 + , aeson >= 0.8, network >= 2.6 , bytestring, text, split, string-conversions , stringsearch , containers, unordered-containers diff --git a/test/Feature/InsertSpec.hs b/test/Feature/InsertSpec.hs index ea6badbb2..b8a37c167 100644 --- a/test/Feature/InsertSpec.hs +++ b/test/Feature/InsertSpec.hs @@ -87,12 +87,7 @@ spec = afterAll_ resetDb $ around withApp $ do context "with invalid json payload" $ it "fails with 400 and error" $ - post "/simple_pk" "}{ x = 2" - `shouldRespondWith` ResponseMatcher { - matchBody = Just [json| {"message":"Failed to parse JSON payload. Failed reading: satisfy"} |] - , matchStatus = 400 - , matchHeaders = [] - } + post "/simple_pk" "}{ x = 2" `shouldRespondWith` 400 context "jsonb" . after_ (clearTable "json") $ do it "serializes nested object" $ do