blob: b692ce3d72b77216f6a8fb863a38fab854b25b84 (
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
30
31
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe PropagateServiceTemplateWorker do
include ExclusiveLeaseHelpers
describe '#perform' do
it 'calls the propagate service with the template' do
template = Integrations::Pushover.create!(
template: true,
active: true,
properties: {
device: 'MyDevice',
sound: 'mic',
priority: 4,
user_key: 'asdf',
api_key: '123456789'
})
stub_exclusive_lease("propagate_service_template_worker:#{template.id}",
timeout: PropagateServiceTemplateWorker::LEASE_TIMEOUT)
expect(Admin::PropagateServiceTemplate)
.to receive(:propagate)
.with(template)
subject.perform(template.id)
end
end
end
|