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
1052f64c
Commit
1052f64c
authored
May 06, 2019
by
Grzegorz Bizon
Committed by
Filipa Lacerda
May 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for Gitaly calls in deployment serialization
parent
b0360335
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
app/serializers/build_details_entity.rb
app/serializers/build_details_entity.rb
+0
-1
spec/controllers/projects/jobs_controller_spec.rb
spec/controllers/projects/jobs_controller_spec.rb
+7
-2
No files found.
app/serializers/build_details_entity.rb
View file @
1052f64c
...
@@ -13,7 +13,6 @@ class BuildDetailsEntity < JobEntity
...
@@ -13,7 +13,6 @@ class BuildDetailsEntity < JobEntity
expose
:deployment_status
,
if:
->
(
*
)
{
build
.
starts_environment?
}
do
expose
:deployment_status
,
if:
->
(
*
)
{
build
.
starts_environment?
}
do
expose
:deployment_status
,
as: :status
expose
:deployment_status
,
as: :status
expose
:persisted_environment
,
as: :environment
,
with:
EnvironmentEntity
expose
:persisted_environment
,
as: :environment
,
with:
EnvironmentEntity
end
end
...
...
spec/controllers/projects/jobs_controller_spec.rb
View file @
1052f64c
...
@@ -253,6 +253,10 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
...
@@ -253,6 +253,10 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
end
end
context
'with deployment'
do
context
'with deployment'
do
before
do
create
(
:deployment
,
:success
,
environment:
environment
,
project:
project
)
end
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
let
(
:environment
)
{
create
(
:environment
,
project:
project
,
name:
'staging'
,
state: :available
)
}
let
(
:environment
)
{
create
(
:environment
,
project:
project
,
name:
'staging'
,
state: :available
)
}
let
(
:job
)
{
create
(
:ci_build
,
:running
,
environment:
environment
.
name
,
pipeline:
pipeline
)
}
let
(
:job
)
{
create
(
:ci_build
,
:running
,
environment:
environment
.
name
,
pipeline:
pipeline
)
}
...
@@ -262,8 +266,9 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
...
@@ -262,8 +266,9 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
).
to
match_schema
(
'job/job_details'
)
expect
(
json_response
).
to
match_schema
(
'job/job_details'
)
expect
(
json_response
[
'deployment_status'
][
"status"
]).
to
eq
'creating'
expect
(
json_response
.
dig
(
'deployment_status'
,
'status'
)).
to
eq
'creating'
expect
(
json_response
[
'deployment_status'
][
"environment"
]).
not_to
be_nil
expect
(
json_response
.
dig
(
'deployment_status'
,
'environment'
)).
not_to
be_nil
expect
(
json_response
.
dig
(
'deployment_status'
,
'environment'
,
'last_deployment'
)).
not_to
be_nil
end
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