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:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-03-23 14:26:21 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-03-23 14:26:21 +0300
commit0335d09e5886288de19e5320e13607e4c70fb4ab (patch)
treedda1e5127314d15dce3a8011a82beb1398e8f0be /spec/lib/gitlab/ci
parentf2ec6c1c344b09b3a911c1fbb69aacb7f15082c5 (diff)
Integrate variables policy with new pipeline services
Diffstat (limited to 'spec/lib/gitlab/ci')
-rw-r--r--spec/lib/gitlab/ci/build/policy/variables_spec.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/lib/gitlab/ci/build/policy/variables_spec.rb b/spec/lib/gitlab/ci/build/policy/variables_spec.rb
index 95a3ab8b329..ce229ed256a 100644
--- a/spec/lib/gitlab/ci/build/policy/variables_spec.rb
+++ b/spec/lib/gitlab/ci/build/policy/variables_spec.rb
@@ -1,8 +1,8 @@
require 'spec_helper'
describe Gitlab::Ci::Build::Policy::Variables do
- let(:pipeline) { build(:ci_pipeline, ref: 'master') }
- let(:attributes) { double(:attributes) }
+ let(:pipeline) { build_stubbed(:ci_empty_pipeline, ref: 'master') }
+ let(:build) { build_stubbed(:ci_build, pipeline: pipeline, ref: 'master') }
before do
pipeline.variables.build(key: 'CI_PROJECT_NAME', value: '')
@@ -12,31 +12,31 @@ describe Gitlab::Ci::Build::Policy::Variables do
it 'is satisfied by a defined and existing variable' do
policy = described_class.new(['$CI_PROJECT_ID', '$UNDEFINED'])
- expect(policy).to be_satisfied_by(pipeline, attributes)
+ expect(policy).to be_satisfied_by(pipeline, build)
end
it 'is not satisfied by an overriden empty variable' do
policy = described_class.new(['$CI_PROJECT_NAME'])
- expect(policy).not_to be_satisfied_by(pipeline, attributes)
+ expect(policy).not_to be_satisfied_by(pipeline, build)
end
it 'is satisfied by a truthy pipeline expression' do
policy = described_class.new([%($CI_PIPELINE_SOURCE == "#{pipeline.source}")])
- expect(policy).to be_satisfied_by(pipeline, attributes)
+ expect(policy).to be_satisfied_by(pipeline, build)
end
it 'is not satisfied by a falsy pipeline expression' do
policy = described_class.new([%($CI_PIPELINE_SOURCE == "invalid source")])
- expect(policy).not_to be_satisfied_by(pipeline, attributes)
+ expect(policy).not_to be_satisfied_by(pipeline, build)
end
it 'is satisfied by a truthy expression using undefined variable' do
policy = described_class.new(['$UNDEFINED', '$UNDEFINED == null'])
- expect(policy).to be_satisfied_by(pipeline, attributes)
+ expect(policy).to be_satisfied_by(pipeline, build)
end
end
end