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
Boxiang Sun
gitlab-ce
Commits
51a61e53
Commit
51a61e53
authored
Dec 06, 2018
by
jhampton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes broken tests
- Adjusts behavior to cover conditional trigger variable values
parent
b6600129
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
spec/controllers/projects/jobs_controller_spec.rb
spec/controllers/projects/jobs_controller_spec.rb
+19
-0
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+0
-1
No files found.
spec/controllers/projects/jobs_controller_spec.rb
View file @
51a61e53
...
@@ -400,6 +400,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
...
@@ -400,6 +400,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
context
'with variables'
do
context
'with variables'
do
before
do
before
do
project
.
add_maintainer
(
user
)
create
(
:ci_pipeline_variable
,
pipeline:
pipeline
,
key: :TRIGGER_KEY_1
,
value:
'TRIGGER_VALUE_1'
)
create
(
:ci_pipeline_variable
,
pipeline:
pipeline
,
key: :TRIGGER_KEY_1
,
value:
'TRIGGER_VALUE_1'
)
get_show
(
id:
job
.
id
,
format: :json
)
get_show
(
id:
job
.
id
,
format: :json
)
...
@@ -415,6 +416,24 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
...
@@ -415,6 +416,24 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
expect
(
json_response
[
'trigger'
][
'variables'
].
first
[
'public'
]).
to
eq
false
expect
(
json_response
[
'trigger'
][
'variables'
].
first
[
'public'
]).
to
eq
false
end
end
end
end
context
'with no variable values'
do
before
do
create
(
:ci_pipeline_variable
,
pipeline:
pipeline
,
key: :TRIGGER_KEY_1
,
value:
'TRIGGER_VALUE_1'
)
get_show
(
id:
job
.
id
,
format: :json
)
end
it
'exposes trigger information and variables'
do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
match_response_schema
(
'job/job_details'
)
expect
(
json_response
[
'trigger'
][
'short_token'
]).
to
eq
'toke'
expect
(
json_response
[
'trigger'
][
'variables'
].
length
).
to
eq
1
expect
(
json_response
[
'trigger'
][
'variables'
].
first
[
'key'
]).
to
eq
"TRIGGER_KEY_1"
expect
(
json_response
[
'trigger'
][
'variables'
].
first
[
'value'
]).
to
be_nil
expect
(
json_response
[
'trigger'
][
'variables'
].
first
[
'public'
]).
to
eq
false
end
end
end
end
def
get_show
(
**
extra_params
)
def
get_show
(
**
extra_params
)
...
...
spec/features/projects/jobs_spec.rb
View file @
51a61e53
...
@@ -354,7 +354,6 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
...
@@ -354,7 +354,6 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
create
(
:ci_build
,
pipeline:
pipeline
,
trigger_request:
trigger_request
)
create
(
:ci_build
,
pipeline:
pipeline
,
trigger_request:
trigger_request
)
end
end
shared_examples
'job with outdated deployment'
do
shared_examples
'job with outdated deployment'
do
it
'shows a link for the job'
do
it
'shows a link for the job'
do
expect
(
page
).
to
have_content
(
'Token'
)
expect
(
page
).
to
have_content
(
'Token'
)
...
...
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