dox Executable Documentation

Edit order

Not admin when opening the page

Given an order 'Test Order' with 2 menus each 2 dishes
When I open the page to edit 'Test Order'
Then I should be redirected to 'list.html'

Not admin when saving

Given an order 'Test Order' with 2 menus each 2 dishes
Given I have opened the page to edit 'Test Order'
When I save the order
Then I should be redirected to 'list.html'

Load dishes

Given I am logged in as admin
Given an order 'Test Order' with 2 menus each 2 dishes starting on '2000-01-03'
Given dish 1 of menu 1 of this order is 'A'
Given dish 2 of menu 1 of this order is 'B'
Given dish 1 of menu 2 of this order is 'C'
Given dish 2 of menu 2 of this order is 'D'
When I open the page to edit 'Test Order'
Then there should be no error message
Then there should be no success message
Then the name of the order should be 'Test Order'
Then there should be 2 menus
Then the date of menu 1 should be 'Monday, 3.1.2000'
Then the date of menu 2 should be 'Tuesday, 4.1.2000'
Then menu 1 should have 2 dishes
Then dish 1 of menu 1 should be 'A'
Then dish 2 of menu 1 should be 'B'
Then dish 1 of menu 2 should be 'C'
Then dish 2 of menu 2 should be 'D'

Save dishes

Given I am logged in as admin
Given an order 'Test Order' with 2 menus each 2 dishes starting on '2000-01-03'
Given I have opened the page to edit 'Test Order'
Given I have entered 'W' for dish 1 of menu 1
Given I have entered 'X' for dish 2 of menu 1
Given I have entered 'Y' for dish 1 of menu 2
Given I have entered 'Z' for dish 2 of menu 2
When I save the order
Then there should be 1 orders
Then there should be 4 dishes
Then there should be a dish 'W'
Then there should be a dish 'X'
Then there should be a dish 'Y'
Then there should be a dish 'Z'
Then the success message should be 'Order saved'
Then there should be no error message
Then the name of the order should be 'Test Order'

Discard empty dishes

Given I am logged in as admin
Given an order 'Test Order' with 2 menus each 3 dishes starting on '2000-01-03'
Given I have opened the page to edit 'Test Order'
Given I have entered 'W' for dish 1 of menu 1
Given I have entered 'X' for dish 2 of menu 1
Given I have entered '' for dish 3 of menu 1
Given I have entered 'Y' for dish 1 of menu 2
Given I have entered '' for dish 2 of menu 2
Given I have entered '' for dish 3 of menu 2
When I save the order
$this->order->thereShouldBe_Menus(2);
Then there should be 3 dishes

Discard empty menu

Given I am logged in as admin
Given an order 'Test Order' with 2 menus each 3 dishes starting on '2000-01-03'
Given I have opened the page to edit 'Test Order'
Given I have entered 'W' for dish 1 of menu 1
Given I have entered 'X' for dish 2 of menu 1
Given I have entered '' for dish 3 of menu 1
Given I have entered '' for dish 1 of menu 2
Given I have entered '' for dish 2 of menu 2
Given I have entered '' for dish 3 of menu 2
When I save the order
Then this order should have 1 menus
Then there should be 2 dishes