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
a306cb5b
Commit
a306cb5b
authored
Dec 07, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorganize Jobs Variables feature spec
parent
5de224e3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
54 deletions
+55
-54
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+55
-54
No files found.
spec/features/projects/jobs_spec.rb
View file @
a306cb5b
...
...
@@ -344,16 +344,18 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
end
end
describe
'
Pipeline trigger variables when user is not a maintainer
'
do
describe
'
Variables
'
do
let
(
:trigger_request
)
{
create
(
:ci_trigger_request
)
}
let
(
:job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
trigger_request:
trigger_request
)
}
shared_examples
'expected variables behavior'
do
context
'when user is a maintainer'
do
shared_examples
'no reveal button variables behavior'
do
it
'renders a hidden value with no reveal values button'
,
:js
do
expect
(
page
).
to
have_content
(
'Token'
)
expect
(
page
).
to
have_content
(
'Variables'
)
expect
(
page
).
not_to
have_css
(
'.js-reveal-variables'
)
expect
(
page
).
to
have_selector
(
'.js-build-variable'
,
text:
'TRIGGER_KEY_1'
)
expect
(
page
).
to
have_selector
(
'.js-build-value'
,
text:
'••••••'
)
end
...
...
@@ -366,7 +368,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
visit
project_job_path
(
project
,
job
)
end
it_behaves_like
'expected
variables behavior'
it_behaves_like
'no reveal button
variables behavior'
end
context
'when variables are stored in pipeline_variables'
do
...
...
@@ -376,20 +378,22 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
visit
project_job_path
(
project
,
job
)
end
it_behaves_like
'expected
variables behavior'
it_behaves_like
'no reveal button
variables behavior'
end
end
describe
'Pipeline trigger variables
when user is a maintainer'
do
let
(
:trigger_request
)
{
create
(
:ci_trigger_request
)
}
let
(
:job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
trigger_request:
trigger_request
)
}
context
'
when user is a maintainer'
do
before
do
project
.
add_maintainer
(
user
)
end
shared_examples
'expected variables behavior when maintaine
r'
do
shared_examples
'reveal button variables behavio
r'
do
it
'renders a hidden value with a reveal values button'
,
:js
do
expect
(
page
).
to
have_content
(
'Token'
)
expect
(
page
).
to
have_content
(
'Variables'
)
expect
(
page
).
to
have_css
(
'.js-reveal-variables'
)
expect
(
page
).
to
have_selector
(
'.js-build-variable'
,
text:
'TRIGGER_KEY_1'
)
expect
(
page
).
to
have_selector
(
'.js-build-value'
,
text:
'••••••'
)
end
...
...
@@ -404,26 +408,23 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
context
'when variables are stored in trigger_request'
do
before
do
project
.
add_maintainer
(
user
)
trigger_request
.
update_attribute
(
:variables
,
{
'TRIGGER_KEY_1'
=>
'TRIGGER_VALUE_1'
}
)
visit
project_job_path
(
project
,
job
)
end
it_behaves_like
'expected variables behavior when maintaine
r'
it_behaves_like
'reveal button variables behavio
r'
end
context
'when variables are stored in pipeline_variables'
do
before
do
project
.
add_maintainer
(
user
)
create
(
:ci_pipeline_variable
,
pipeline:
pipeline
,
key:
'TRIGGER_KEY_1'
,
value:
'TRIGGER_VALUE_1'
)
visit
project_job_path
(
project
,
job
)
end
it_behaves_like
'expected variables behavior when maintainer'
it_behaves_like
'reveal button variables behavior'
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