summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-05-06 16:48:00 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-05-06 16:48:00 +0000
commit58aa2d7f395be4aee38b5202ef1666879505c737 (patch)
tree123dd501e842b6f7da658a2d24c587539d5360b3 /spec/lib
parent927a9b13f083b7610d7ab31fa4204c1991668ddb (diff)
parent3417221ee6d3b8b0b6a895821a9fdff307359063 (diff)
downloadgitlab-ce-58aa2d7f395be4aee38b5202ef1666879505c737.tar.gz
Merge branch '44059-specify-variables-when-executing-a-manual-pipeline-from-the-ui' into 'master'
Resolve "Specify variables when executing a manual pipeline from the UI" Closes #44059 See merge request gitlab-org/gitlab-ce!18440
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/ci/pipeline/chain/build_spec.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/chain/build_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/build_spec.rb
index 3ae7053a995..85d73e5c382 100644
--- a/spec/lib/gitlab/ci/pipeline/chain/build_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/chain/build_spec.rb
@@ -5,6 +5,10 @@ describe Gitlab::Ci::Pipeline::Chain::Build do
set(:user) { create(:user) }
let(:pipeline) { Ci::Pipeline.new }
+ let(:variables_attributes) do
+ [{ key: 'first', secret_value: 'world' },
+ { key: 'second', secret_value: 'second_world' }]
+ end
let(:command) do
Gitlab::Ci::Pipeline::Chain::Command.new(
source: :push,
@@ -15,7 +19,8 @@ describe Gitlab::Ci::Pipeline::Chain::Build do
trigger_request: nil,
schedule: nil,
project: project,
- current_user: user)
+ current_user: user,
+ variables_attributes: variables_attributes)
end
let(:step) { described_class.new(pipeline, command) }
@@ -39,6 +44,8 @@ describe Gitlab::Ci::Pipeline::Chain::Build do
expect(pipeline.tag).to be false
expect(pipeline.user).to eq user
expect(pipeline.project).to eq project
+ expect(pipeline.variables.map { |var| var.slice(:key, :secret_value) })
+ .to eq variables_attributes.map(&:with_indifferent_access)
end
it 'sets a valid config source' do