Skip to content

Instantly share code, notes, and snippets.

@ximus
Created May 14, 2012 23:23
Show Gist options
  • Save ximus/2698050 to your computer and use it in GitHub Desktop.
Save ximus/2698050 to your computer and use it in GitHub Desktop.
Scenario: Schedule a send time which is *future* to the deal's end date
Given the following deal exists:
| slug | status | end_at |
| deal789 | in-flight | Time.now.tomorrow.midnight - 2.hours |
When I send a POST request to /api/v1/targeted_emails with the following:
"""
{
"api_key" : "homerun",
"deal_id" : 123,
"user_ids" : [user123],
"mode" : "augment",
"send_at" : <%= Time.now.tomorrow.midnight - 1.hour %>
}
"""
Then the json at "status" should be "error"
And the json at "error_type" should be "send_at is after deal's end time"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment