spec/event_spec.rb in reactor-0.9.5 vs spec/event_spec.rb in reactor-0.9.6
- old
+ new
@@ -9,10 +9,13 @@
end
class ArbitraryModel < ActiveRecord::Base
end
+class OtherWorker
+ include Sidekiq::Worker
+end
describe Reactor::Event do
let(:model) { ArbitraryModel.create! }
let(:event_name) { :user_did_this }
@@ -110,9 +113,17 @@
Reactor::Event.publish :turtle_time, at: time, actor: actor
expect {
Reactor::Event.reschedule :turtle_time, at: time + 2.hours, was: time, actor: actor
}.not_to change { scheduled.size}.from(1)
+ end
+
+ it 'will skip jobs of other classes' do
+ OtherWorker.perform_in(1.minute, 'foo')
+
+ expect {
+ Reactor::Event.reschedule :turtle_time, at: time + 2.hours, was: time, actor: actor
+ }.to change { scheduled.size}.from(1).to(2)
end
end
end
describe 'event content' do