spec/event_spec.rb in reactor-0.13.0 vs spec/event_spec.rb in reactor-0.14.0

- old
+ new

@@ -61,11 +61,19 @@ Reactor::Event.publish(:user_did_this, actor_id: '1') end end describe 'perform' do - before { Reactor::Subscriber.create(event_name: :user_did_this) } - after { Reactor::Subscriber.destroy_all } + before do + Reactor::Subscriber.create(event_name: :user_did_this) + Reactor.enable_test_mode_subscriber(Reactor::Subscriber) + end + + after do + Reactor::Subscriber.destroy_all + Reactor.enable_test_mode_subscriber(Reactor::Subscriber) + end + it 'fires all subscribers' do expect_any_instance_of(Reactor::Subscriber).to receive(:fire).with(hash_including(actor_id: model.id.to_s)) Reactor::Event.perform(event_name, actor_id: model.id.to_s, actor_type: model.class.to_s) end