From 614192edfd6b389e5c60e7675f0506c220bffa8f Mon Sep 17 00:00:00 2001 From: Andrzej Krzywda Date: Tue, 28 Nov 2023 20:23:17 +0100 Subject: [PATCH] ItemAddedToBasket#quantity_before was not used anywhere --- ecommerce/ordering/lib/ordering/order.rb | 1 - .../ordering/test/add_item_to_basket_test.rb | 31 +++++++++---------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/ecommerce/ordering/lib/ordering/order.rb b/ecommerce/ordering/lib/ordering/order.rb index 8d7aac185..54fe9f1ac 100644 --- a/ecommerce/ordering/lib/ordering/order.rb +++ b/ecommerce/ordering/lib/ordering/order.rb @@ -64,7 +64,6 @@ def add_item(product_id) data: { order_id: @id, product_id: product_id, - quantity_before: @basket.quantity(product_id) } ) end diff --git a/ecommerce/ordering/test/add_item_to_basket_test.rb b/ecommerce/ordering/test/add_item_to_basket_test.rb index 53ce4bd5a..d33ae672c 100644 --- a/ecommerce/ordering/test/add_item_to_basket_test.rb +++ b/ecommerce/ordering/test/add_item_to_basket_test.rb @@ -9,24 +9,21 @@ def test_item_is_added_to_draft_order stream = "Ordering::Order$#{aggregate_id}" product_id = SecureRandom.uuid - [0, 1].each do |quantity_before| - expected_events = [ - ItemAddedToBasket.new( - data: { - order_id: aggregate_id, - product_id: product_id, - quantity_before: quantity_before - } - ) - ] - assert_events(stream, *expected_events) do - act( - AddItemToBasket.new( - order_id: aggregate_id, - product_id: product_id - ) + expected_events = [ + ItemAddedToBasket.new( + data: { + order_id: aggregate_id, + product_id: product_id, + } + ) + ] + assert_events(stream, *expected_events) do + act( + AddItemToBasket.new( + order_id: aggregate_id, + product_id: product_id ) - end + ) end end