spec/gush/worker_spec.rb in gush-2.0.2 vs spec/gush/worker_spec.rb in gush-2.1.0
- old
+ new
@@ -2,10 +2,12 @@
describe Gush::Worker do
subject { described_class.new }
let!(:workflow) { TestWorkflow.create }
+ let(:locking_duration) { 5 }
+ let(:polling_interval) { 0.5 }
let!(:job) { client.find_job(workflow.id, "Prepare") }
let(:config) { Gush.configuration.to_json }
let!(:client) { Gush::Client.new }
describe "#perform" do
@@ -68,8 +70,14 @@
end
workflow = OkayWorkflow.create
subject.perform(workflow.id, 'OkayJob')
+ end
+
+ it 'calls RedisMutex.with_lock with customizable locking_duration and polling_interval' do
+ expect(RedisMutex).to receive(:with_lock)
+ .with(anything, block: 5, sleep: 0.5).twice
+ subject.perform(workflow.id, 'Prepare')
end
end
end