Skip to content

Instantly share code, notes, and snippets.

@graphicbeacon
Created May 30, 2018 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save graphicbeacon/bb34eac1c95348995cc48e8b8ac20af4 to your computer and use it in GitHub Desktop.
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)
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