From ec614728f676a684819087f9d08c153054639166 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 24 May 2018 12:43:48 +0200 Subject: [PATCH] Fix the conflict resolution in spec/models/ci/runner_spec.rb --- spec/models/ci/runner_spec.rb | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 2bd6e16a6cd..08578c27e37 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -612,32 +612,16 @@ describe Ci::Runner do end describe '.assignable_for' do - let(:runner) { create(:ci_runner, :project, projects: [project]) } let(:project) { create(:project) } + let(:group) { create(:group) } let(:another_project) { create(:project) } + let!(:unlocked_project_runner) { create(:ci_runner, :project, projects: [project]) } + let!(:locked_project_runner) { create(:ci_runner, :project, locked: true, projects: [project]) } + let!(:group_runner) { create(:ci_runner, :group, groups: [group]) } + let!(:instance_runner) { create(:ci_runner, :instance) } - context 'with shared runners' do - let(:runner) { create(:ci_runner, :instance) } - - context 'does not give owned runner' do - subject { described_class.assignable_for(project) } - - it { is_expected.to be_empty } - end - - context 'does not give shared runner' do - subject { described_class.assignable_for(another_project) } - - it { is_expected.to be_empty } - end - end - - context 'with unlocked runner' do - context 'does not give owned runner' do - subject { described_class.assignable_for(project) } - - it { is_expected.to be_empty } - end + context 'with already assigned project' do + subject { described_class.assignable_for(project) } it { is_expected.to be_empty } end