Test insertion of various json types

This commit is contained in:
Joe Nelson
2014-08-27 12:48:41 -07:00
parent 134ca1f2a8
commit d06674a1e8
4 changed files with 48 additions and 18 deletions
+8
View File
@@ -33,6 +33,14 @@ instance JSON.FromJSON IncPK where
spec :: Spec
spec = around appWithFixture $
describe "Posting new record" $ do
it "accepts disparate json types" $
post "/menagerie"
[json| {
"integer": 13, "double": 3.14159, "varchar": "testing!"
, "boolean": false, "date": "01/01/1900", "money": "$3.99"
} |]
`shouldRespondWith` 201
context "with no pk supplied" $ do
context "into a table with auto-incrementing pk" $
it "succeeds with 201 and link" $ do
-3
View File
@@ -3,12 +3,9 @@ module Feature.RangeSpec where
import Test.Hspec
import Test.Hspec.Wai
import Test.Hspec.Wai.JSON
import SpecHelper
import Network.HTTP.Types
spec :: Spec
spec = around appWithFixture $ do
describe "GET /view" $
+1
View File
@@ -17,6 +17,7 @@ spec = around appWithFixture $ do
[json| [
{"schema":"1","name":"auto_incrementing_pk","insertable":true}
, {"schema":"1","name":"compound_pk","insertable":true}
, {"schema":"1","name":"menagerie","insertable":true}
, {"schema":"1","name":"simple_pk","insertable":true}
] |]
{matchStatus = 200}