Commit 80cc9df9 authored by Matija Čupić's avatar Matija Čupić

Use variables_attributes intead of variables

parent 2a9a01b9
...@@ -24,7 +24,7 @@ module Ci ...@@ -24,7 +24,7 @@ module Ci
ignore_skip_ci: ignore_skip_ci, ignore_skip_ci: ignore_skip_ci,
save_incompleted: save_on_errors, save_incompleted: save_on_errors,
seeds_block: block, seeds_block: block,
variables: params[:variables_attributes], variables_attributes: params[:variables_attributes],
project: project, project: project,
current_user: current_user) current_user: current_user)
......
...@@ -18,12 +18,12 @@ describe Ci::CreatePipelineService do ...@@ -18,12 +18,12 @@ describe Ci::CreatePipelineService do
message: 'Message', message: 'Message',
ref: ref_name, ref: ref_name,
trigger_request: nil, trigger_request: nil,
variables: nil) variables_attributes: nil)
params = { ref: ref, params = { ref: ref,
before: '00000000', before: '00000000',
after: after, after: after,
commits: [{ message: message }], commits: [{ message: message }],
variables_attributes: variables } variables_attributes: variables_attributes }
described_class.new(project, user, params).execute( described_class.new(project, user, params).execute(
source, trigger_request: trigger_request) source, trigger_request: trigger_request)
...@@ -549,17 +549,17 @@ describe Ci::CreatePipelineService do ...@@ -549,17 +549,17 @@ describe Ci::CreatePipelineService do
end end
context 'when pipeline variables are specified' do context 'when pipeline variables are specified' do
let(:variables) do let(:variables_attributes) do
[{ key: 'first', secret_value: 'world' }, [{ key: 'first', secret_value: 'world' },
{ key: 'second', secret_value: 'second_world' }] { key: 'second', secret_value: 'second_world' }]
end end
subject { execute_service(variables: variables) } subject { execute_service(variables_attributes: variables_attributes) }
it 'creates a pipeline with specified variables' do it 'creates a pipeline with specified variables' do
expect(subject.variables.count).to eq(variables.count) expect(subject.variables.count).to eq(variables_attributes.count)
expect(subject.variables.first.key).to eq(variables.first[:key]) expect(subject.variables.first.key).to eq(variables_attributes.first[:key])
expect(subject.variables.last.secret_value).to eq(variables.last[:secret_value]) expect(subject.variables.last.secret_value).to eq(variables_attributes.last[:secret_value])
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment