Commit 409514e4 authored by Luke Duncalfe's avatar Luke Duncalfe
parent 0b85f4ec
...@@ -145,35 +145,29 @@ RSpec.describe Integration do ...@@ -145,35 +145,29 @@ RSpec.describe Integration do
describe '#can_test?' do describe '#can_test?' do
subject { integration.can_test? } subject { integration.can_test? }
context 'when repository is not empty' do context 'when project-level integration' do
let(:project) { create(:project, :repository) }
it { is_expected.to be true }
end
context 'when repository is empty' do
let(:project) { create(:project) } let(:project) { create(:project) }
it { is_expected.to be true } it { is_expected.to be true }
end end
context 'when instance-level service' do context 'when instance-level integration' do
Integration.available_integration_types.each do |type| Integration.available_integration_types.each do |type|
let(:integration) do let(:integration) do
described_class.send(:integration_type_to_model, type).new(instance: true) described_class.send(:integration_type_to_model, type).new(instance: true)
end end
it { is_expected.to be_falsey } it { is_expected.to be false }
end end
end end
context 'when group-level service' do context 'when group-level integration' do
Integration.available_integration_types.each do |type| Integration.available_integration_types.each do |type|
let(:integration) do let(:integration) do
described_class.send(:integration_type_to_model, type).new(group_id: group.id) described_class.send(:integration_type_to_model, type).new(group_id: group.id)
end end
it { is_expected.to be_falsey } it { is_expected.to be false }
end end
end 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