Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
80cc9df9
Commit
80cc9df9
authored
Apr 18, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use variables_attributes intead of variables
parent
2a9a01b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
app/services/ci/create_pipeline_service.rb
app/services/ci/create_pipeline_service.rb
+1
-1
spec/services/ci/create_pipeline_service_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
+7
-7
No files found.
app/services/ci/create_pipeline_service.rb
View file @
80cc9df9
...
...
@@ -24,7 +24,7 @@ module Ci
ignore_skip_ci:
ignore_skip_ci
,
save_incompleted:
save_on_errors
,
seeds_block:
block
,
variables:
params
[
:variables_attributes
],
variables
_attributes
:
params
[
:variables_attributes
],
project:
project
,
current_user:
current_user
)
...
...
spec/services/ci/create_pipeline_service_spec.rb
View file @
80cc9df9
...
...
@@ -18,12 +18,12 @@ describe Ci::CreatePipelineService do
message:
'Message'
,
ref:
ref_name
,
trigger_request:
nil
,
variables:
nil
)
variables
_attributes
:
nil
)
params
=
{
ref:
ref
,
before:
'00000000'
,
after:
after
,
commits:
[{
message:
message
}],
variables_attributes:
variables
}
variables_attributes:
variables
_attributes
}
described_class
.
new
(
project
,
user
,
params
).
execute
(
source
,
trigger_request:
trigger_request
)
...
...
@@ -549,17 +549,17 @@ describe Ci::CreatePipelineService do
end
context
'when pipeline variables are specified'
do
let
(
:variables
)
do
let
(
:variables
_attributes
)
do
[{
key:
'first'
,
secret_value:
'world'
},
{
key:
'second'
,
secret_value:
'second_world'
}]
end
subject
{
execute_service
(
variables
:
variabl
es
)
}
subject
{
execute_service
(
variables
_attributes:
variables_attribut
es
)
}
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
])
expect
(
subject
.
variables
.
count
).
to
eq
(
variables
_attributes
.
count
)
expect
(
subject
.
variables
.
first
.
key
).
to
eq
(
variables
_attributes
.
first
[
:key
])
expect
(
subject
.
variables
.
last
.
secret_value
).
to
eq
(
variables
_attributes
.
last
[
:secret_value
])
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment