Skip to content

Instantly share code, notes, and snippets.

@tooky
Last active April 19, 2018 16:06
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 tooky/a1b3764b3bea4bbad49b8d11ff5fbc16 to your computer and use it in GitHub Desktop.
Save tooky/a1b3764b3bea4bbad49b8d11ff5fbc16 to your computer and use it in GitHub Desktop.
gherkin <3 properties
Feature: Calculate order total
Rule: discounts are applied for eligible, registered users
Given the registered customer
| email | <email> |
| eligible for discount | <eligible> |
| discount | <discount> |
When there is an order by <order-email> for <amount>
Then the order total should be <total>
Properties: registered users who are eligible get a discount
| email | any valid email |
| eligible | true |
| discount | 0-100 |
| order-email | equals <email> |
| spend | greater than 0 |
| total | <spend> x <discount> |
Properties: registered users who are not eligible don't get a discount
| email | any valid email |
| eligible | false |
| discount | 0-100 |
| order-email | equals <email> |
| spend | greater than 0 |
| total | <spend> |
Properties: non-registered users don't get a discount
| email | any valid email |
| eligible | true |
| discount | 1-100 |
| order-email | any valid email except <email> |
| spend | greater than 0 |
| total | <spend> |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment