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