File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
rails_application/test/orders Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments