diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-04-18 18:42:58 +0200 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-04-18 18:42:58 +0200 |
commit | 2a9a01b955c1f8081d669724d8592e4cac7d5f19 (patch) | |
tree | b622999d3e4da94a8a864f67ac5f776d48a83708 /spec/services/ci/create_pipeline_service_spec.rb | |
parent | 0d70dd6c48bed0f14b095521087c8b189b6b56fa (diff) | |
download | gitlab-ce-2a9a01b955c1f8081d669724d8592e4cac7d5f19.tar.gz |
Add variables option to Ci::CreatePipelineService
Diffstat (limited to 'spec/services/ci/create_pipeline_service_spec.rb')
-rw-r--r-- | spec/services/ci/create_pipeline_service_spec.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb index 267258b33a8..652603df854 100644 --- a/spec/services/ci/create_pipeline_service_spec.rb +++ b/spec/services/ci/create_pipeline_service_spec.rb @@ -17,11 +17,13 @@ describe Ci::CreatePipelineService do after: project.commit.id, message: 'Message', ref: ref_name, - trigger_request: nil) + trigger_request: nil, + variables: nil) params = { ref: ref, before: '00000000', after: after, - commits: [{ message: message }] } + commits: [{ message: message }], + variables_attributes: variables } described_class.new(project, user, params).execute( source, trigger_request: trigger_request) @@ -545,5 +547,20 @@ describe Ci::CreatePipelineService do expect(pipeline.tag?).to be true end end + + context 'when pipeline variables are specified' do + let(:variables) do + [{ key: 'first', secret_value: 'world' }, + { key: 'second', secret_value: 'second_world' }] + end + + subject { execute_service(variables: variables) } + + it 'creates a pipeline with specified variables' do + expect(subject.variables.count).to eq(variables.count) + expect(subject.variables.first.key).to eq(variables.first[:key]) + expect(subject.variables.last.secret_value).to eq(variables.last[:secret_value]) + end + end end end |