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:
authorLin Jen-Shin <godfat@godfat.org>2017-05-26 20:46:57 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-05-26 20:46:57 +0300
commit2785bc4faa0eb5c46b0c8b46b77aa4cf1d4ee4b4 (patch)
tree2b53225328d3d32341a54124466a0a4084b9d0c8 /spec/models/ci
parent9cc918a5caca931887026d258ea1dcd6499d7c2f (diff)
Merge secret and protected vars to variables_for(ref)
Also introduce Ci::Variable#to_runner_variable to build up the hash for runner.
Diffstat (limited to 'spec/models/ci')
-rw-r--r--spec/models/ci/build_spec.rb2
-rw-r--r--spec/models/ci/variable_spec.rb7
2 files changed, 8 insertions, 1 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index 0cc1fc2b360..6e7aa3d5841 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -1384,7 +1384,7 @@ describe Ci::Build, :models do
allow(project).to receive(:predefined_variables) { ['project'] }
allow(pipeline).to receive(:predefined_variables) { ['pipeline'] }
allow(build).to receive(:yaml_variables) { ['yaml'] }
- allow(project).to receive(:secret_variables) { ['secret'] }
+ allow(project).to receive(:variables_for).with(build.ref) { ['secret'] }
end
it { is_expected.to eq(%w[predefined project pipeline yaml secret]) }
diff --git a/spec/models/ci/variable_spec.rb b/spec/models/ci/variable_spec.rb
index fe8c52d5353..38b869f59ae 100644
--- a/spec/models/ci/variable_spec.rb
+++ b/spec/models/ci/variable_spec.rb
@@ -36,4 +36,11 @@ describe Ci::Variable, models: true do
to raise_error(OpenSSL::Cipher::CipherError, 'bad decrypt')
end
end
+
+ describe '#to_runner_variable' do
+ it 'returns a hash for the runner' do
+ expect(subject.to_runner_variable)
+ .to eq(key: subject.key, value: subject.value, public: false)
+ end
+ end
end