diff options
author | Matija Čupić <matteeyah@gmail.com> | 2019-07-29 10:43:10 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-07-29 10:43:10 +0300 |
commit | a5aa40c5fe93dc3daba8a578f4c09c4e443fcbec (patch) | |
tree | 34eb74d209b1919f78ce70d89ee0900cd2602780 /spec/controllers/projects | |
parent | 946f7c0687760ec49aca582a329d0ec3c7ac3037 (diff) |
Add Job specific variables
Adds Job specific variables to facilitate specifying variables when
running manual jobs.
Diffstat (limited to 'spec/controllers/projects')
-rw-r--r-- | spec/controllers/projects/jobs_controller_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/controllers/projects/jobs_controller_spec.rb b/spec/controllers/projects/jobs_controller_spec.rb index e428aa3c7b7..39ebf02dcf5 100644 --- a/spec/controllers/projects/jobs_controller_spec.rb +++ b/spec/controllers/projects/jobs_controller_spec.rb @@ -676,6 +676,8 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do end describe 'POST play' do + let(:variable_attributes) { [] } + before do project.add_developer(user) @@ -698,6 +700,14 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do it 'transits to pending' do expect(job.reload).to be_pending end + + context 'when job variables are specified' do + let(:variable_attributes) { [{ key: 'first', secret_value: 'first' }] } + + it 'assigns the job variables' do + expect(job.reload.job_variables.map(&:key)).to contain_exactly('first') + end + end end context 'when job is not playable' do @@ -712,7 +722,8 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do post :play, params: { namespace_id: project.namespace, project_id: project, - id: job.id + id: job.id, + job_variables_attributes: variable_attributes } end end |