spec/models/subscriber_spec.rb in reactor-0.6.2 vs spec/models/subscriber_spec.rb in reactor-0.7.0
- old
+ new
@@ -9,25 +9,23 @@
end
describe Reactor::Subscriber do
describe 'fire' do
- subject { MySubscriber.create(event: :you_name_it).fire some: 'random', event: 'data' }
+ subject { MySubscriber.create(event_name: :you_name_it).fire some: 'random', event: 'data' }
- its(:message) { should be_a Reactor::Event }
- its('message.some') { should == 'random' }
+ its(:event) { should be_a Reactor::Event }
+ its('event.some') { should == 'random' }
it 'executes block given' do
subject.was_called.should be_true
end
end
- describe '.subscribes_to class helper' do
- end
describe 'matcher' do
it 'can be set to star to bind to all events' do
- MySubscriber.create!(event: '*')
+ MySubscriber.create!(event_name: '*')
MySubscriber.any_instance.should_receive(:fire).with(hash_including('random' => 'data', 'event' => 'this_event'))
Reactor::Event.publish(:this_event, {random: 'data'})
end
end
end