Created
September 28, 2017 23:26
-
-
Save dustinfarris/c0985a3d85fed192c3615a444fafbd76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module PersonTest exposing (..) | |
import Expect | |
import Fuzz exposing (int, string) | |
import Json.Decode exposing (decodeValue) | |
import Json.Encode as Json | |
import Person exposing (..) | |
import Test exposing (..) | |
suite : Test | |
suite = | |
describe "the Person Module" | |
[ fuzz3 int string string "personDecoder maps to a Person" <| | |
\id firstName lastName -> | |
let | |
json = | |
Json.object | |
[ ( "id", Json.int id ) | |
, ( "first_name", Json.string firstName ) | |
, ( "last_name", Json.string lastName ) | |
] | |
in | |
decodeValue personDecoder json | |
|> Expect.equal | |
(Ok { id = id, firstName = firstName, lastName = lastName }) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment