diff --git a/tests/CartTest.php b/tests/CartTest.php index 8d624e0..7edc9d9 100644 --- a/tests/CartTest.php +++ b/tests/CartTest.php @@ -246,6 +246,21 @@ class CartTest extends Orchestra\Testbench\TestCase $this->assertRowsInCart(1, $cart); } + /** @test */ + public function it_will_keep_updating_the_quantity_when_an_item_is_added_multiple_times() + { + $cart = $this->getCart(); + + $item = $this->getBuyableMock(); + + $cart->add($item); + $cart->add($item); + $cart->add($item); + + $this->assertItemsInCart(3, $cart); + $this->assertRowsInCart(1, $cart); + } + /** @test */ public function it_can_update_the_quantity_of_an_existing_item_in_the_cart() {