Skip to content

Instantly share code, notes, and snippets.

@kevinswiber
Last active August 29, 2015 13:55
Show Gist options
  • Save kevinswiber/8696975 to your computer and use it in GitHub Desktop.
Save kevinswiber/8696975 to your computer and use it in GitHub Desktop.
Exploring hypermedia aware acceptance testing.
Feature: Root Resource
As an API client
I want to see the root resource
So that I have a starting point to complete my task.
Scenario: Request the root
Given an anonymous client
When I make a GET request to /
Then I should get a 200 status code
And the content type should be JSON
Scenario: Request the hypermedia root
Given an anonymous client
When I make a request to the root URI
Then the request should succeed
And the response media type should be Siren
And the response should include a self link
@kevinswiber
Copy link
Author

@zdne

Certainly. The only reason I made the distinction of "hypermedia" in the scenario is because I'm actually executing the specifications and needed a way to distinguish between the two. :)

This is still riddled with technical details that are irrelevant to the domain. Of course, I have a lot more experience writing automated acceptance tests for domain logic, not APIs. When the reader happens to be a developer, perhaps this is perfectly acceptable. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment