gitlab-org--gitlab-foss/spec/workers/propagate_project_service_w...

30 lines
675 B
Ruby
Raw Normal View History

2017-05-03 13:43:26 +00:00
require 'spec_helper'
describe PropagateProjectServiceWorker do
2017-05-04 10:13:33 +00:00
let!(:service_template) do
PushoverService.create(
template: true,
active: true,
properties: {
device: 'MyDevice',
sound: 'mic',
priority: 4,
user_key: 'asdf',
api_key: '123456789'
})
end
2017-05-03 13:43:26 +00:00
2017-05-04 10:13:33 +00:00
before do
allow_any_instance_of(Gitlab::ExclusiveLease).to receive(:try_obtain).
and_return(true)
end
2017-05-03 13:43:26 +00:00
2017-05-04 10:13:33 +00:00
describe '#perform' do
it 'calls the propagate service with the template' do
expect(Projects::PropagateService).to receive(:propagate).with(service_template)
2017-05-03 13:43:26 +00:00
subject.perform(service_template.id)
2017-05-03 13:43:26 +00:00
end
end
end