Skip to content

Instantly share code, notes, and snippets.

@samsamm777
Created March 7, 2017 15:56
Show Gist options
  • Save samsamm777/caaf04cb9b2ece66df1918254eb4cfcf to your computer and use it in GitHub Desktop.
Save samsamm777/caaf04cb9b2ece66df1918254eb4cfcf to your computer and use it in GitHub Desktop.
Scenario: Ensure we can successfully create panel revisions and prove the panel
revision number increments properly.
Given I send a header-signed "POST" request to "/show/$showId/panel" with content type "application/json" with body:
"""
{
"title": "my show",
"description": "this is a test show"
}
"""
And the response code should be 201
And I store response value "id" as "panelId"
And I reset the headers
Then I send a header-signed "GET" request to "/show/$showId/panel/$panelId"
And the response code should be 200
And the response should contain json values by path
| path | value |
| id | 1 |
And I reset the headers
And I define a test series "panel-revisions" as
| stepId | nowMutation | data |
| 1 | minutes+1 | woof |
| 2 | | meow |
| 3 | | quack |
| 4 | | moo |
And I define expectations for test series "panel-revisions" as
| stepId | targetType | targetDesc | expectedValue |
| * | responseCode | | 201 |
| 1 | contentPath | data.sound | woof |
| 1 | contentPath | revision_number | 2 |
| 2 | contentPath | data.sound | meow |
| 2 | contentPath | revision_number | 3 |
| 3 | contentPath | data.sound | quack |
| 3 | contentPath | revision_number | 4 |
| 4 | contentPath | data.sound | moo |
| 4 | contentPath | revision_number | 5 |
And I send header-signed "POST" requests using test series "panel-revisions" at time modified by "nowMutation" to "/show/$showId/panel/$panelId/revision" with content type "application/json" and body:
"""
{
"data": {
"sound": $data
}
}
"""
And I reset the headers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment