From a5aa40c5fe93dc3daba8a578f4c09c4e443fcbec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20=C4=8Cupi=C4=87?= Date: Mon, 29 Jul 2019 07:43:10 +0000 Subject: Add Job specific variables Adds Job specific variables to facilitate specifying variables when running manual jobs. --- spec/services/ci/play_build_service_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'spec/services/ci/play_build_service_spec.rb') diff --git a/spec/services/ci/play_build_service_spec.rb b/spec/services/ci/play_build_service_spec.rb index 1e68b7956ea..cf39f3da4fe 100644 --- a/spec/services/ci/play_build_service_spec.rb +++ b/spec/services/ci/play_build_service_spec.rb @@ -60,6 +60,19 @@ describe Ci::PlayBuildService, '#execute' do expect(build.reload.user).to eq user end + + context 'when variables are supplied' do + let(:job_variables) do + [{ key: 'first', secret_value: 'first' }, + { key: 'second', secret_value: 'second' }] + end + + it 'assigns the variables to the build' do + service.execute(build, job_variables) + + expect(build.reload.job_variables.map(&:key)).to contain_exactly('first', 'second') + end + end end context 'when build is not a playable manual action' do -- cgit v1.2.1