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
Jérome Perrin
gitlab-ce
Commits
08a0bc53
Commit
08a0bc53
authored
Mar 11, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more specs
parent
448c695c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
1 deletion
+30
-1
spec/controllers/projects/builds_controller_spec.rb
spec/controllers/projects/builds_controller_spec.rb
+3
-0
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+3
-0
spec/controllers/projects/pipelines_controller_spec.rb
spec/controllers/projects/pipelines_controller_spec.rb
+3
-0
spec/serializers/build_serializer_spec.rb
spec/serializers/build_serializer_spec.rb
+18
-1
spec/serializers/pipeline_serializer_spec.rb
spec/serializers/pipeline_serializer_spec.rb
+3
-0
No files found.
spec/controllers/projects/builds_controller_spec.rb
View file @
08a0bc53
...
...
@@ -27,6 +27,9 @@ describe Projects::BuildsController do
it
'return a correct pipeline status'
do
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
json_response
[
'text'
]).
to
eq
status
.
text
expect
(
json_response
[
'label'
]).
to
eq
status
.
label
expect
(
json_response
[
'icon'
]).
to
eq
status
.
icon
expect
(
json_response
[
'favicon'
]).
to
eq
status
.
favicon
end
end
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
08a0bc53
...
...
@@ -1198,6 +1198,9 @@ describe Projects::MergeRequestsController do
it
'return a correct pipeline status'
do
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
json_response
[
'text'
]).
to
eq
status
.
text
expect
(
json_response
[
'label'
]).
to
eq
status
.
label
expect
(
json_response
[
'icon'
]).
to
eq
status
.
icon
expect
(
json_response
[
'favicon'
]).
to
eq
status
.
favicon
end
end
...
...
spec/controllers/projects/pipelines_controller_spec.rb
View file @
08a0bc53
...
...
@@ -86,6 +86,9 @@ describe Projects::PipelinesController do
it
'return a correct pipeline status'
do
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
json_response
[
'text'
]).
to
eq
status
.
text
expect
(
json_response
[
'label'
]).
to
eq
status
.
label
expect
(
json_response
[
'icon'
]).
to
eq
status
.
icon
expect
(
json_response
[
'favicon'
]).
to
eq
status
.
favicon
end
end
...
...
spec/serializers/build_serializer_spec.rb
View file @
08a0bc53
...
...
@@ -10,7 +10,21 @@ describe BuildSerializer do
subject
{
serializer
.
represent
(
resource
)
}
describe
'#represent'
do
# TODO:
context
'when a single object is being serialized'
do
let
(
:resource
)
{
create
(
:ci_build
)
}
it
'serializers the pipeline object'
do
expect
(
subject
[
:id
]).
to
eq
resource
.
id
end
end
context
'when multiple objects are being serialized'
do
let
(
:resource
)
{
create_list
(
:ci_build
,
2
)
}
it
'serializers the array of pipelines'
do
expect
(
subject
).
not_to
be_empty
end
end
end
describe
'#represent_status'
do
...
...
@@ -23,6 +37,9 @@ describe BuildSerializer do
subject
{
serializer
.
represent_status
(
resource
)
}
it
'serializes only status'
do
expect
(
subject
[
:text
]).
to
eq
(
status
.
text
)
expect
(
subject
[
:label
]).
to
eq
(
status
.
label
)
expect
(
subject
[
:icon
]).
to
eq
(
status
.
icon
)
expect
(
subject
[
:favicon
]).
to
eq
(
status
.
favicon
)
end
end
...
...
spec/serializers/pipeline_serializer_spec.rb
View file @
08a0bc53
...
...
@@ -105,6 +105,9 @@ describe PipelineSerializer do
subject
{
serializer
.
represent_status
(
resource
)
}
it
'serializes only status'
do
expect
(
subject
[
:text
]).
to
eq
(
status
.
text
)
expect
(
subject
[
:label
]).
to
eq
(
status
.
label
)
expect
(
subject
[
:icon
]).
to
eq
(
status
.
icon
)
expect
(
subject
[
:favicon
]).
to
eq
(
status
.
favicon
)
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