summaryrefslogtreecommitdiff
path: root/spec/workers/propagate_service_template_worker_spec.rb
blob: b8b65ead9b36e4ab6871a97efb07ea9b84d601c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
    allow_any_instance_of(Gitlab::ExclusiveLease).to receive(:try_obtain)
      .and_return(true)
  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