Commit 16a83724 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix pipeline config source specs and test it explicitly

parent 9293842d
......@@ -868,21 +868,17 @@ describe Ci::Pipeline, :mailer do
end
describe '#set_config_source' do
context 'on object initialisation' do
context 'when pipelines does not contain needed data' do
let(:pipeline) do
Ci::Pipeline.new
end
it 'defines source to be unknown' do
pipeline.set_config_source
expect(pipeline).to be_unknown_source
end
end
context 'when pipeline contains all needed data' do
let(:pipeline) do
Ci::Pipeline.new(
project: project,
create(:ci_pipeline, project: project,
sha: '1234',
ref: 'master',
source: :push)
......@@ -895,6 +891,8 @@ describe Ci::Pipeline, :mailer do
end
it 'defines source to be from repository' do
pipeline.set_config_source
expect(pipeline).to be_repository_source
end
......@@ -920,7 +918,7 @@ describe Ci::Pipeline, :mailer do
end
it 'defines source to be auto devops' do
subject
pipeline.set_config_source
expect(pipeline).to be_auto_devops_source
end
......@@ -928,7 +926,6 @@ describe Ci::Pipeline, :mailer do
end
end
end
end
describe '#ci_yaml_file' do
let(:implied_yml) { Gitlab::Template::GitlabCiYmlTemplate.find('Auto-DevOps').content }
......
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