propagate_project_service_worker_spec.rb 675 字节
Newer Older
J
James Lopez 已提交
1 2
require 'spec_helper'

3
describe PropagateProjectServiceWorker do
J
James Lopez 已提交
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
J
James Lopez 已提交
16

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

J
James Lopez 已提交
22 23
  describe '#perform' do
    it 'calls the propagate service with the template' do
24
      expect(Projects::PropagateService).to receive(:propagate).with(service_template)
J
James Lopez 已提交
25

26
      subject.perform(service_template.id)
J
James Lopez 已提交
27 28 29
    end
  end
end