|
| 1 | +Feature: The sales department creates a quote |
| 2 | + |
| 3 | + Background: |
| 4 | + Given the process is created from the "quote" scenario |
| 5 | + And "Alice" is the "customer" actor |
| 6 | + And "Bob" is the "sales" actor |
| 7 | + |
| 8 | + When "Alice" does "request" with: |
| 9 | + | company | Acme Inc | |
| 10 | + | contact | Alice | |
| 11 | + | email | alice@example.com | |
| 12 | + | address | 123 Main St | |
| 13 | + | requirements | The product should be able to do X, Y and Z | |
| 14 | + Then the process is in "requested" |
| 15 | + |
| 16 | + Scenario: Sales creates a quote |
| 17 | + When "Bob" does "create_quote" with "cms:quotes/test.pdf" |
| 18 | + Then the last event is not skipped |
| 19 | + And the process is in "quoted" |
| 20 | + And the result is "cms:quotes/test.pdf" |
| 21 | + And service "email" is notified with: |
| 22 | + """yaml |
| 23 | + $schema: schema:messages/email-v1 |
| 24 | + to: |
| 25 | + name: Alice |
| 26 | + |
| 27 | + template: quote |
| 28 | + data: |
| 29 | + customer: |
| 30 | + title: Customer |
| 31 | + id: !ref actors.customer.id |
| 32 | + company: Acme Inc |
| 33 | + contact: Alice |
| 34 | + |
| 35 | + address: 123 Main St |
| 36 | + generate_token: !ref actors.customer.id |
| 37 | + attachments: |
| 38 | + - |
| 39 | + filename: quote.pdf |
| 40 | + file: cms:quotes/test.pdf |
| 41 | + """ |
| 42 | + |
| 43 | + Scenario: Sales cancels the process |
| 44 | + When "Bob" does "cancel" with: |
| 45 | + | reason | Unable to deliver on requirements | |
| 46 | + Then the last event is not skipped |
| 47 | + And the process ended in "cancelled" |
| 48 | + And the state description is: |
| 49 | + """ |
| 50 | + The quote request has been cancelled. |
| 51 | + Reason: Unable to deliver on requirements |
| 52 | + """ |
| 53 | + And service "email" is notified with: |
| 54 | + """yaml |
| 55 | + $schema: schema:messages/email-v1 |
| 56 | + to: |
| 57 | + name: Alice |
| 58 | + |
| 59 | + template: no-quote |
| 60 | + data: |
| 61 | + customer: |
| 62 | + title: Customer |
| 63 | + id: !ref actors.customer.id |
| 64 | + company: Acme Inc |
| 65 | + contact: Alice |
| 66 | + |
| 67 | + address: 123 Main St |
| 68 | + reason: Unable to deliver on requirements |
| 69 | + """ |
| 70 | + |
| 71 | + Scenario: Customer cancels the process |
| 72 | + When "Alice" does "cancel" with: |
| 73 | + | reason | No longer interested | |
| 74 | + Then the last event is not skipped |
| 75 | + And the process ended in "cancelled" |
| 76 | + And the state description is: |
| 77 | + """ |
| 78 | + The quote request has been cancelled. |
| 79 | + Reason: No longer interested |
| 80 | + """ |
| 81 | + And service "email" is not notified |
0 commit comments