Skip to content

Commit d6808ff

Browse files
missing test coverage for stores/shipments
1 parent f7a7543 commit d6808ff

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
require_relative 'test_helper'
2+
module Stores
3+
class ShipmentRegistrationTest < Test
4+
cover "Stores*"
5+
6+
def test_shipment_should_get_registered
7+
store_id = SecureRandom.uuid
8+
shipment_id = SecureRandom.uuid
9+
assert register_shipment(store_id, shipment_id)
10+
end
11+
12+
def test_should_publish_event
13+
store_id = SecureRandom.uuid
14+
shipment_id = SecureRandom.uuid
15+
shipment_registered = Stores::ShipmentRegistered.new(data: { store_id: store_id, shipment_id: shipment_id })
16+
assert_events("Stores::Store$#{store_id}", shipment_registered) do
17+
register_shipment(store_id, shipment_id)
18+
end
19+
end
20+
21+
private
22+
23+
def register_shipment(store_id, shipment_id)
24+
run_command(RegisterShipment.new(store_id: store_id, shipment_id: shipment_id))
25+
end
26+
end
27+
end

0 commit comments

Comments
 (0)