Created
April 17, 2013 15:32
-
-
Save scytacki/5405286 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Feature: External Activities can support a REST api | |
Background: | |
Given the following external REST activity: | |
| name | "Cool Thing" | | |
| create_url | "http://activity.example.com/activity/1/sessions/" | | |
And "activity.example.com/activity/1/sessions/" handles a POST and responds with | |
""" | |
HTTP/1.1 201 Created | |
Location: http://example.com/activity/1/sessions/1 | |
Content-Type: application/json | |
{ | |
"id": 1 | |
} | |
""" | |
And "activity.example.com/activity/1/sessions/1" handles a GET and responds with | |
""" | |
HTTP/1.1 200 OK | |
Content-Type: text/plain | |
Super Cool Activity here. | |
""" | |
Scenario: External REST activity is run the first time | |
When a student first runs the external activity "Cool Thing" | |
Then the portal should send a POST to "activity.example.com/activity/1/sessions/" | |
And the browser should send a GET to "activity.example.com/activity/1/sessions/1" | |
Scenario: External REST activity is run the second time | |
Given a student has already run the external REST activity "Cool Thing" before | |
When a student first runs the external activity "Cool Thing" | |
Then the portal should not send a POST to "activity.example.com/activity/1/sessions/" | |
And the browser should send a GET to "activity.example.com/activity/1/sessions/1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment