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
3ab01363
Commit
3ab01363
authored
Mar 27, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for evaluating secret variables in a policy
parent
da6bfd9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
spec/lib/gitlab/ci/build/policy/variables_spec.rb
spec/lib/gitlab/ci/build/policy/variables_spec.rb
+10
-2
No files found.
spec/lib/gitlab/ci/build/policy/variables_spec.rb
View file @
3ab01363
...
...
@@ -48,13 +48,21 @@ describe Gitlab::Ci::Build::Policy::Variables do
expect
(
policy
).
to
be_satisfied_by
(
pipeline
,
seed
)
end
it
'allows to evaluate regular secret variables'
do
secret
=
create
(
:ci_variable
,
project:
project
,
key:
'SECRET'
,
value:
'secret value'
)
policy
=
described_class
.
new
([
"$SECRET == 'secret value'"
])
expect
(
policy
).
to
be_satisfied_by
(
pipeline
,
seed
)
end
it
'does not persist neither pipeline nor build'
do
described_class
.
new
(
'$VAR'
).
satisfied_by?
(
pipeline
,
seed
)
expect
(
pipeline
).
not_to
be_persisted
expect
(
seed
.
to_resource
).
not_to
be_persisted
end
pending
'test for secret variables'
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