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
|
2021-07-21 11:08:52 -04:00
|
|
|
let(:project) { create(:project) }
|
2020-05-20 14:08:00 -04:00
|
|
|
let(:integration) do
|
2021-06-02 08:10:05 -04:00
|
|
|
Integrations::Pushover.create!(
|
2021-07-21 11:08:52 -04:00
|
|
|
project: project,
|
2020-05-20 14:08:00 -04:00
|
|
|
active: true,
|
|
|
|
device: 'MyDevice',
|
|
|
|
sound: 'mic',
|
|
|
|
priority: 4,
|
|
|
|
user_key: 'asdf',
|
|
|
|
api_key: '123456789'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'calls the propagate service with the integration' do
|
2021-11-18 04:10:16 -05:00
|
|
|
expect(Integrations::PropagateService).to receive(:propagate).with(integration)
|
2020-08-27 11:10:21 -04:00
|
|
|
|
|
|
|
subject.perform(integration.id)
|
|
|
|
end
|
2020-05-20 14:08:00 -04:00
|
|
|
end
|
|
|
|
end
|