BigW Consortium Gitlab

propagate_service_template_worker_spec.rb 684 Bytes
Newer Older
James Lopez committed
1 2
require 'spec_helper'

3
describe PropagateServiceTemplateWorker do
4 5 6 7 8 9 10 11 12 13 14 15
  let!(:service_template) do
    PushoverService.create(
      template: true,
      active: true,
      properties: {
        device: 'MyDevice',
        sound: 'mic',
        priority: 4,
        user_key: 'asdf',
        api_key: '123456789'
      })
  end
James Lopez committed
16

17
  before do
18 19
    allow_any_instance_of(Gitlab::ExclusiveLease).to receive(:try_obtain)
      .and_return(true)
20
  end
James Lopez committed
21

22 23
  describe '#perform' do
    it 'calls the propagate service with the template' do
24
      expect(Projects::PropagateServiceTemplate).to receive(:propagate).with(service_template)
James Lopez committed
25

26
      subject.perform(service_template.id)
James Lopez committed
27 28 29
    end
  end
end