Skip to content

Instantly share code, notes, and snippets.

@tooky
Last active Apr 19, 2018
Embed
What would you like to do?
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