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
38b1ec2c
Commit
38b1ec2c
authored
Mar 11, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rspec failure
parent
ea08e2c8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
12 deletions
+21
-12
app/controllers/projects/builds_controller.rb
app/controllers/projects/builds_controller.rb
+1
-2
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-2
app/controllers/projects/pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+1
-2
spec/controllers/projects/builds_controller_spec.rb
spec/controllers/projects/builds_controller_spec.rb
+6
-2
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+6
-2
spec/controllers/projects/pipelines_controller_spec.rb
spec/controllers/projects/pipelines_controller_spec.rb
+6
-2
No files found.
app/controllers/projects/builds_controller.rb
View file @
38b1ec2c
...
@@ -76,8 +76,7 @@ class Projects::BuildsController < Projects::ApplicationController
...
@@ -76,8 +76,7 @@ class Projects::BuildsController < Projects::ApplicationController
def
status
def
status
render
json:
BuildSerializer
render
json:
BuildSerializer
.
new
(
project:
@project
,
user:
@current_user
)
.
new
(
project:
@project
,
user:
@current_user
)
.
only_status
.
represent_status
(
@build
)
.
represent
(
@build
)
end
end
def
erase
def
erase
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
38b1ec2c
...
@@ -476,8 +476,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -476,8 +476,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def
status
def
status
render
json:
PipelineSerializer
render
json:
PipelineSerializer
.
new
(
project:
@project
,
user:
@current_user
)
.
new
(
project:
@project
,
user:
@current_user
)
.
only_status
.
represent_status
(
@merge_request
.
head_pipeline
)
.
represent
(
@merge_request
.
head_pipeline
)
end
end
def
ci_environments_status
def
ci_environments_status
...
...
app/controllers/projects/pipelines_controller.rb
View file @
38b1ec2c
...
@@ -75,8 +75,7 @@ class Projects::PipelinesController < Projects::ApplicationController
...
@@ -75,8 +75,7 @@ class Projects::PipelinesController < Projects::ApplicationController
def
status
def
status
render
json:
PipelineSerializer
render
json:
PipelineSerializer
.
new
(
project:
@project
,
user:
@current_user
)
.
new
(
project:
@project
,
user:
@current_user
)
.
only_status
.
represent_status
(
@pipeline
)
.
represent
(
@pipeline
)
end
end
def
stage
def
stage
...
...
spec/controllers/projects/builds_controller_spec.rb
View file @
38b1ec2c
...
@@ -12,9 +12,13 @@ describe Projects::BuildsController do
...
@@ -12,9 +12,13 @@ describe Projects::BuildsController do
describe
'GET status.json'
do
describe
'GET status.json'
do
context
'when accessing status'
do
context
'when accessing status'
do
let
(
:status
)
do
Gitlab
::
Ci
::
Status
::
Success
.
new
(
double
(
'object'
),
double
(
'user'
))
end
before
do
before
do
pipeline
=
create
(
:ci_pipeline
,
project:
project
)
pipeline
=
create
(
:ci_pipeline
,
project:
project
)
build
=
create
(
:ci_build
,
pipeline:
pipeline
,
status:
'success'
)
build
=
create
(
:ci_build
,
pipeline:
pipeline
,
status:
:success
)
get
:status
,
namespace_id:
project
.
namespace
,
get
:status
,
namespace_id:
project
.
namespace
,
project_id:
project
,
project_id:
project
,
id:
build
.
id
,
id:
build
.
id
,
...
@@ -23,7 +27,7 @@ describe Projects::BuildsController do
...
@@ -23,7 +27,7 @@ describe Projects::BuildsController do
it
'return a correct pipeline status'
do
it
'return a correct pipeline status'
do
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
json_response
[
'
details'
][
'status'
][
'text'
]).
to
eq
'passed'
expect
(
json_response
[
'
favicon'
]).
to
eq
status
.
favicon
end
end
end
end
end
end
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
38b1ec2c
...
@@ -1181,11 +1181,15 @@ describe Projects::MergeRequestsController do
...
@@ -1181,11 +1181,15 @@ describe Projects::MergeRequestsController do
describe
'GET status.json'
do
describe
'GET status.json'
do
context
'when accessing status'
do
context
'when accessing status'
do
let
(
:status
)
do
Gitlab
::
Ci
::
Status
::
Success
.
new
(
double
(
'object'
),
double
(
'user'
))
end
before
do
before
do
create
(
:ci_pipeline
,
project:
merge_request
.
source_project
,
create
(
:ci_pipeline
,
project:
merge_request
.
source_project
,
ref:
merge_request
.
source_branch
,
ref:
merge_request
.
source_branch
,
sha:
merge_request
.
diff_head_sha
,
sha:
merge_request
.
diff_head_sha
,
status:
'success'
)
status:
:success
)
get
:status
,
namespace_id:
project
.
namespace
,
get
:status
,
namespace_id:
project
.
namespace
,
project_id:
project
,
project_id:
project
,
id:
merge_request
.
iid
,
id:
merge_request
.
iid
,
...
@@ -1194,7 +1198,7 @@ describe Projects::MergeRequestsController do
...
@@ -1194,7 +1198,7 @@ describe Projects::MergeRequestsController do
it
'return a correct pipeline status'
do
it
'return a correct pipeline status'
do
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
json_response
[
'
details'
][
'status'
][
'text'
]).
to
eq
'passed'
expect
(
json_response
[
'
favicon'
]).
to
eq
status
.
favicon
end
end
end
end
end
end
...
...
spec/controllers/projects/pipelines_controller_spec.rb
View file @
38b1ec2c
...
@@ -72,8 +72,12 @@ describe Projects::PipelinesController do
...
@@ -72,8 +72,12 @@ describe Projects::PipelinesController do
describe
'GET status.json'
do
describe
'GET status.json'
do
context
'when accessing status'
do
context
'when accessing status'
do
let
(
:status
)
do
Gitlab
::
Ci
::
Status
::
Success
.
new
(
double
(
'object'
),
double
(
'user'
))
end
before
do
before
do
pipeline
=
create
(
:ci_pipeline
,
project:
project
,
status:
'success'
)
pipeline
=
create
(
:ci_pipeline
,
project:
project
,
status:
:success
)
get
:status
,
namespace_id:
project
.
namespace
,
get
:status
,
namespace_id:
project
.
namespace
,
project_id:
project
,
project_id:
project
,
id:
pipeline
.
id
,
id:
pipeline
.
id
,
...
@@ -82,7 +86,7 @@ describe Projects::PipelinesController do
...
@@ -82,7 +86,7 @@ describe Projects::PipelinesController do
it
'return a correct pipeline status'
do
it
'return a correct pipeline status'
do
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
json_response
[
'
details'
][
'status'
][
'text'
]).
to
eq
'passed'
expect
(
json_response
[
'
favicon'
]).
to
eq
status
.
favicon
end
end
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