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