Skip to content

Instantly share code, notes, and snippets.

@moklett
Created September 10, 2010 13:50
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 moklett/573658 to your computer and use it in GitHub Desktop.
Save moklett/573658 to your computer and use it in GitHub Desktop.
Scenario: Clear site data for a test site
Given my site is in test mode
And I have 2 products
And I have 4 subscriptions
When I send a POST request to https://[@subdomain].chargify.com/sites/clear_data.json
Then the response status should be "200 OK"
And I should have 0 products
And I should have 0 subscriptions
Scenario: Attempt to clear site data for a production site
Given my site is in production mode
And I have 2 products
And I have 4 subscriptions
When I send a POST request to https://[@subdomain].chargify.com/sites/clear_data.json
Then the response status should be "403 Forbidden"
And I should have 2 products
And I should have 4 subscriptions
Scenario: Clear site data for a test site, leaving products
Given my site is in test mode
And I have 2 products
And I have 4 subscriptions
When I send a POST request to https://[@subdomain].chargify.com/sites/clear_data.json?cleanup_scope=customers
Then the response status should be "200 OK"
And I should have 2 products
And I should have 0 subscriptions
Scenario: Clear all site data for a test site using the explicit 'all' scope
Given my site is in test mode
And I have 2 products
And I have 4 subscriptions
When I send a POST request to https://[@subdomain].chargify.com/sites/clear_data.json?cleanup_scope=all
Then the response status should be "200 OK"
And I should have 0 products
And I should have 0 subscriptions
Scenario: Attempt to clear site data for a test site using a bogus scope
Given my site is in test mode
And I have 2 products
And I have 4 subscriptions
When I send a POST request to https://[@subdomain].chargify.com/sites/clear_data.json?cleanup_scope=bogus
Then the response status should be "403 Forbidden"
And I should have 2 products
And I should have 4 subscriptions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment