Skip to content

Commit

Permalink
ItemAddedToBasket#quantity_before was not used anywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejkrzywda committed Nov 28, 2023
1 parent 8b0c5cc commit 614192e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
1 change: 0 additions & 1 deletion ecommerce/ordering/lib/ordering/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def add_item(product_id)
data: {
order_id: @id,
product_id: product_id,
quantity_before: @basket.quantity(product_id)
}
)
end
Expand Down
31 changes: 14 additions & 17 deletions ecommerce/ordering/test/add_item_to_basket_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 614192e

Please sign in to comment.