Commit 2f054c2d authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix specs related to creating a pipeline / EE compatibility

parent 6c3ac5da
...@@ -6,7 +6,7 @@ FactoryBot.define do ...@@ -6,7 +6,7 @@ FactoryBot.define do
trait :project do trait :project do
before(:create) do |cluster, evaluator| before(:create) do |cluster, evaluator|
cluster.projects << create(:project) cluster.projects << create(:project, :repository)
end end
end end
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Pipeline::Chain::Populate do describe Gitlab::Ci::Pipeline::Chain::Populate do
set(:project) { create(:project) } set(:project) { create(:project, :repository) }
set(:user) { create(:user) } set(:user) { create(:user) }
let(:pipeline) do let(:pipeline) do
...@@ -139,7 +139,7 @@ describe Gitlab::Ci::Pipeline::Chain::Populate do ...@@ -139,7 +139,7 @@ describe Gitlab::Ci::Pipeline::Chain::Populate do
end end
let(:pipeline) do let(:pipeline) do
build(:ci_pipeline, ref: 'master', config: config) build(:ci_pipeline, ref: 'master', project: project, config: config)
end end
it 'populates pipeline according to used policies' do it 'populates pipeline according to used policies' do
......
...@@ -269,7 +269,7 @@ describe Ci::Pipeline, :mailer do ...@@ -269,7 +269,7 @@ describe Ci::Pipeline, :mailer do
context 'when refs policy is specified' do context 'when refs policy is specified' do
let(:pipeline) do let(:pipeline) do
build(:ci_pipeline, ref: 'feature', tag: true, config: config) build(:ci_pipeline, ref: 'feature', tag: true, project: project, config: config)
end end
let(:config) do let(:config) do
...@@ -287,7 +287,9 @@ describe Ci::Pipeline, :mailer do ...@@ -287,7 +287,9 @@ describe Ci::Pipeline, :mailer do
end end
context 'when source policy is specified' do context 'when source policy is specified' do
let(:pipeline) { build(:ci_pipeline, source: :schedule, config: config) } let(:pipeline) do
build(:ci_pipeline, source: :schedule, project: project, config: config)
end
let(:config) do let(:config) do
{ production: { stage: 'deploy', script: 'cap prod', only: ['triggers'] }, { production: { stage: 'deploy', script: 'cap prod', only: ['triggers'] },
...@@ -327,7 +329,7 @@ describe Ci::Pipeline, :mailer do ...@@ -327,7 +329,7 @@ describe Ci::Pipeline, :mailer do
end end
context 'when user configured kubernetes from Integration > Kubernetes' do context 'when user configured kubernetes from Integration > Kubernetes' do
let(:project) { create(:kubernetes_project) } let(:project) { create(:kubernetes_project, :repository) }
let(:pipeline) { build(:ci_pipeline, project: project, config: config) } let(:pipeline) { build(:ci_pipeline, project: project, config: config) }
it_behaves_like 'same behavior between KubernetesService and Platform::Kubernetes' it_behaves_like 'same behavior between KubernetesService and Platform::Kubernetes'
...@@ -355,13 +357,15 @@ describe Ci::Pipeline, :mailer do ...@@ -355,13 +357,15 @@ describe Ci::Pipeline, :mailer do
describe '#seeds_size' do describe '#seeds_size' do
context 'when refs policy is specified' do context 'when refs policy is specified' do
let(:project) { create(:project, :repository) }
let(:config) do let(:config) do
{ production: { stage: 'deploy', script: 'cap prod', only: ['master'] }, { production: { stage: 'deploy', script: 'cap prod', only: ['master'] },
spinach: { stage: 'test', script: 'spinach', only: ['tags'] } } spinach: { stage: 'test', script: 'spinach', only: ['tags'] } }
end end
let(:pipeline) do let(:pipeline) do
build(:ci_pipeline, ref: 'feature', tag: true, config: config) build(:ci_pipeline, ref: 'feature', tag: true, project: project, config: config)
end end
it 'returns real seeds size' do it 'returns real seeds size' do
......
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