debian-mirror-gitlab/spec/workers/propagate_service_template_worker_spec.rb

30 lines
684 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require 'spec_helper'
describe PropagateServiceTemplateWorker do
let!(:service_template) do
PushoverService.create(
template: true,
active: true,
properties: {
device: 'MyDevice',
sound: 'mic',
priority: 4,
user_key: 'asdf',
api_key: '123456789'
})
end
before do
2017-09-10 17:25:29 +05:30
allow_any_instance_of(Gitlab::ExclusiveLease).to receive(:try_obtain)
.and_return(true)
2017-08-17 22:00:37 +05:30
end
describe '#perform' do
it 'calls the propagate service with the template' do
expect(Projects::PropagateServiceTemplate).to receive(:propagate).with(service_template)
subject.perform(service_template.id)
end
end
end