Commit 409514e4 authored by Luke Duncalfe's avatar Luke Duncalfe
parent 0b85f4ec
......@@ -145,35 +145,29 @@ RSpec.describe Integration do
describe '#can_test?' do
subject { integration.can_test? }
context 'when repository is not empty' do
let(:project) { create(:project, :repository) }
it { is_expected.to be true }
end
context 'when repository is empty' do
context 'when project-level integration' do
let(:project) { create(:project) }
it { is_expected.to be true }
end
context 'when instance-level service' do
context 'when instance-level integration' do
Integration.available_integration_types.each do |type|
let(:integration) do
described_class.send(:integration_type_to_model, type).new(instance: true)
end
it { is_expected.to be_falsey }
it { is_expected.to be false }
end
end
context 'when group-level service' do
context 'when group-level integration' do
Integration.available_integration_types.each do |type|
let(:integration) do
described_class.send(:integration_type_to_model, type).new(group_id: group.id)
end
it { is_expected.to be_falsey }
it { is_expected.to be false }
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment