Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2017-08-31 14:47:29 +0300
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2017-08-31 23:25:26 +0300
commit35b9213cd7e378a732991a11bc8b5fa9e711c52b (patch)
tree1264d29ec30665db944dffa3ea8d0fb9a7480c0a /spec/models/ci
parent770bcf71bb85c9eff13f4eb14cbd517986da9056 (diff)
Add config_source to ci_pipelines
Given the user can soon have multiple config sources for CI, we now store what type at the time of the pipeline run we chose. This will give us insight into what triggered the new pipeline so we can display it to the enduser.
Diffstat (limited to 'spec/models/ci')
-rw-r--r--spec/models/ci/pipeline_spec.rb23
1 files changed, 18 insertions, 5 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index a7e0da04f55..80cf872a5fd 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -794,14 +794,27 @@ describe Ci::Pipeline, :mailer do
expect(pipeline.ci_yaml_file).to be_a(String)
expect(pipeline.ci_yaml_file).not_to eq(implied_yml)
expect(pipeline.yaml_errors).to be_nil
+ expect(pipeline.repository?).to be(true)
end
- it 'returns the implied configuration when its not found' do
- allow_any_instance_of(ApplicationSetting)
- .to receive(:auto_devops_enabled?) { true }
- allow(pipeline.project).to receive(:ci_config_path) { 'custom' }
+ context 'when the implied configuration will be used' do
+ before do
+ allow_any_instance_of(ApplicationSetting)
+ .to receive(:auto_devops_enabled?) { true }
+ end
- expect(pipeline.ci_yaml_file).to eq(implied_yml)
+ it 'returns the implied configuration when its not found' do
+ allow(pipeline.project).to receive(:ci_config_path) { 'custom' }
+
+ expect(pipeline.ci_yaml_file).to eq(implied_yml)
+ end
+
+ it 'sets the config source' do
+ allow(pipeline.project).to receive(:ci_config_path) { 'custom' }
+
+ expect(pipeline.ci_yaml_file).to eq(implied_yml)
+ expect(pipeline.auto_devops?).to be(true)
+ end
end
end