Created
May 30, 2018 18:59
-
-
Save graphicbeacon/bb34eac1c95348995cc48e8b8ac20af4 to your computer and use it in GitHub Desktop.
Sample code for "Building RESTful Web APIs with Dart, Aqueduct and PostgreSQL (Part 4)" post on Medium (7)
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
group("books controller", () { | |
test("GET /books returns list of books", () async { | |
// Arrange | |
var request = app.client.request("/books"); | |
// Act | |
var response = await request.get(); | |
// Assert | |
expectResponse(response, 200, | |
body: everyElement(partial( | |
{ | |
"title": isString, | |
"author": isString, | |
"year": isInteger | |
}))); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment