[Behat] Changed promotions total step

This commit is contained in:
Mateusz Zalewski 2016-02-22 16:35:37 +01:00
parent 2fc82dcbd0
commit a6569e0208
4 changed files with 10 additions and 10 deletions

View file

@ -15,7 +15,7 @@ Feature: Receiving fixed discount on cart
And it gives "10.00" fixed discount to every order
When I add product "PHP T-Shirt" to the cart
Then my cart total should be "90.00"
And my cart promotions should be "-10.00"
And my discount should be "-10.00"
@ui
Scenario: Receiving fixed discount equal to the items total of my cart
@ -24,7 +24,7 @@ Feature: Receiving fixed discount on cart
When I add product "PHP T-Shirt" to the cart
And I add product "PHP Mug" to the cart
Then my cart total should be "0.00"
And my cart promotions should be "-106.00"
And my discount should be "-106.00"
@ui
Scenario: Receiving fixed discount equal to the items total of my cart even if the discount is bigger than the items total
@ -32,7 +32,7 @@ Feature: Receiving fixed discount on cart
And it gives "200.00" fixed discount to every order
When I add product "PHP T-Shirt" to the cart
Then my cart total should be "0.00"
And my cart promotions should be "-100.00"
And my discount should be "-100.00"
@ui
Scenario: Receiving fixed discount does not affect the shipping fee
@ -44,4 +44,4 @@ Feature: Receiving fixed discount on cart
And I proceed selecting "DHL" shipping method
Then my cart total should be "100.00"
And my cart shipping fee should be "10.00"
And my cart promotions should be "-10.00"
And my discount should be "-10.00"

View file

@ -14,7 +14,7 @@ Feature: Receiving percentage discount promotion on order
Scenario: Receiving percentage discount for my cart
When I add product "PHP T-Shirt" to the cart
Then my cart total should be "80.00"
And my cart promotions should be "-20.00"
And my discount should be "-20.00"
@ui
Scenario: Receiving percentage discount does not affect the shipping fee
@ -24,4 +24,4 @@ Feature: Receiving percentage discount promotion on order
And I proceed selecting "DHL" shipping method
Then my cart total should be "90.00"
And my cart shipping fee should be "10.00"
And my cart promotions should be "-20.00"
And my discount should be "-20.00"

View file

@ -124,9 +124,9 @@ final class CartContext implements Context
}
/**
* @Then my cart promotions should be :promotionsTotal
* @Then my discount should be :promotionsTotal
*/
public function myCartPromotionsShouldBe($promotionsTotal)
public function myDiscountShouldBe($promotionsTotal)
{
$this->cartSummaryPage->open();

View file

@ -77,7 +77,7 @@ class CartContextSpec extends ObjectBehavior
$cartSummaryPage->open()->shouldBeCalled();
$cartSummaryPage->getPromotionTotal()->willReturn('$50.00');
$this->myCartPromotionsShouldBe('$50.00');
$this->myDiscountShouldBe('$50.00');
}
function it_throws_not_equal_exception_if_promotion_total_is_incorrect(CartSummaryPage $cartSummaryPage)
@ -85,6 +85,6 @@ class CartContextSpec extends ObjectBehavior
$cartSummaryPage->open()->shouldBeCalled();
$cartSummaryPage->getPromotionTotal()->willReturn('$40.00');
$this->shouldThrow(NotEqualException::class)->during('myCartPromotionsShouldBe', ['$50.00']);
$this->shouldThrow(NotEqualException::class)->during('myDiscountShouldBe', ['$50.00']);
}
}