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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
a60ccef9
Commit
a60ccef9
authored
Mar 27, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for method that exposes build variables hash
parent
3ab01363
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
app/models/ci/build.rb
app/models/ci/build.rb
+0
-3
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+12
-0
No files found.
app/models/ci/build.rb
View file @
a60ccef9
...
...
@@ -288,9 +288,6 @@ module Ci
.
to_runner_variables
end
##
# TODO, add specs
#
def
variables_hash
scoped_variables
.
to_hash
end
...
...
spec/models/ci/build_spec.rb
View file @
a60ccef9
...
...
@@ -2053,6 +2053,18 @@ describe Ci::Build do
end
end
describe
'#variables_hash'
do
before
do
project
.
variables
.
create!
(
key:
'MY_VAR'
,
value:
'my value 1'
)
pipeline
.
variables
.
create!
(
key:
'MY_VAR'
,
value:
'my value 2'
)
end
it
'returns a regular hash created in valid order'
do
expect
(
build
.
variables_hash
).
to
include
(
'MY_VAR'
:
'my value 2'
)
expect
(
build
.
variables_hash
).
not_to
include
(
'MY_VAR'
:
'my value 1'
)
end
end
describe
'state transition: any => [:pending]'
do
let
(
:build
)
{
create
(
:ci_build
,
:created
)
}
...
...
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