Skip to content

Commit 33faf26

Browse files
Revert "Removed test which was misleading and had no impact on coverage"
This reverts commit f2f42b9.
1 parent 32170af commit 33faf26

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

rails_application/test/orders/discount_test.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,21 @@ def test_remove_discount
5959
assert event_store.event_in_stream?(event_store.read.of_type([Pricing::PercentageDiscountRemoved]).last.event_id, "Orders$all")
6060
end
6161

62+
def test_does_not_remove_percentage_discount_when_removing_time_promotion
63+
customer_id = SecureRandom.uuid
64+
product_id = SecureRandom.uuid
65+
order_id = SecureRandom.uuid
66+
create_active_time_promotion
67+
customer_registered(customer_id)
68+
prepare_product(product_id)
69+
item_added_to_basket(order_id, product_id)
70+
set_percentage_discount(order_id)
71+
72+
assert_no_changes -> { Orders::Order.find_by(uid: order_id).percentage_discount } do
73+
travel_to(1.minute.from_now) { item_added_to_basket(order_id, product_id) }
74+
end
75+
end
76+
6277
def test_newest_event_is_always_applied
6378
customer_id = SecureRandom.uuid
6479
product_id = SecureRandom.uuid

0 commit comments

Comments
 (0)