From 82ed2a0909823807f3ece2cb29bfc501293361a0 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Wed, 6 Sep 2017 18:57:07 +0200 Subject: Improve config source handling code --- spec/models/ci/pipeline_spec.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'spec') diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index ff8f476d482..8b36fffd808 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -832,10 +832,10 @@ describe Ci::Pipeline, :mailer do describe '#ci_yaml_file' do let(:implied_yml) { Gitlab::Template::GitlabCiYmlTemplate.find('Auto-DevOps').content } - before { pipeline.detect_ci_yaml_file } - context 'the source is unknown' do - before { pipeline.unknown_source! } + before do + pipeline.unknown_source! + end it 'returns the configuration if found' do allow(pipeline.project.repository).to receive(:gitlab_ci_yml_for) @@ -854,7 +854,9 @@ describe Ci::Pipeline, :mailer do end context 'the source is the repository' do - before { pipeline.repository_source! } + before do + pipeline.repository_source! + end it 'returns the configuration if found' do allow(pipeline.project.repository).to receive(:gitlab_ci_yml_for) @@ -867,7 +869,9 @@ describe Ci::Pipeline, :mailer do end context 'when the source is auto_devops_source' do - before { pipeline.auto_devops_source! } + before do + pipeline.auto_devops_source! + end it 'finds the implied config' do allow_any_instance_of(ApplicationSetting) -- cgit v1.2.1