2020-05-20 14:08:00 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 11:08:50 -04:00
|
|
|
RSpec.describe PropagateIntegrationWorker do
|
2020-05-20 14:08:00 -04:00
|
|
|
describe '#perform' do
|
|
|
|
let(:integration) do
|
2020-08-03 14:10:05 -04:00
|
|
|
PushoverService.create!(
|
2020-05-20 14:08:00 -04:00
|
|
|
template: true,
|
|
|
|
active: true,
|
|
|
|
device: 'MyDevice',
|
|
|
|
sound: 'mic',
|
|
|
|
priority: 4,
|
|
|
|
user_key: 'asdf',
|
|
|
|
api_key: '123456789'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'calls the propagate service with the integration' do
|
2020-08-27 11:10:21 -04:00
|
|
|
expect(Admin::PropagateIntegrationService).to receive(:propagate).with(integration)
|
|
|
|
|
|
|
|
subject.perform(integration.id)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'ignores overwrite parameter from previous version' do
|
|
|
|
expect(Admin::PropagateIntegrationService).to receive(:propagate).with(integration)
|
2020-05-20 14:08:00 -04:00
|
|
|
|
|
|
|
subject.perform(integration.id, true)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|