2020-06-23 00:09:42 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe PropagateIntegrationWorker do
|
2020-06-23 00:09:42 +05:30
|
|
|
describe '#perform' do
|
|
|
|
let(:integration) do
|
2021-09-04 01:27:46 +05:30
|
|
|
Integrations::Pushover.create!(
|
2020-06-23 00:09:42 +05:30
|
|
|
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-11-24 15:15:51 +05:30
|
|
|
expect(Admin::PropagateIntegrationService).to receive(:propagate).with(integration)
|
|
|
|
|
|
|
|
subject.perform(integration.id)
|
|
|
|
end
|
2020-06-23 00:09:42 +05:30
|
|
|
end
|
|
|
|
end
|