debian-mirror-gitlab/spec/workers/propagate_integration_worker_spec.rb

32 lines
783 B
Ruby
Raw Normal View History

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
2020-10-24 23:57:45 +05:30
PushoverService.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
it 'ignores overwrite parameter from previous version' do
expect(Admin::PropagateIntegrationService).to receive(:propagate).with(integration)
2020-06-23 00:09:42 +05:30
subject.perform(integration.id, true)
end
end
end