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
e1394f44
Commit
e1394f44
authored
Mar 22, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add builds_controller_specs and spec for #trace
parent
7f08eeed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
spec/controllers/projects/builds_controller_specs.rb
spec/controllers/projects/builds_controller_specs.rb
+47
-0
No files found.
spec/controllers/projects/builds_controller_specs.rb
0 → 100644
View file @
e1394f44
require
'spec_helper'
describe
Projects
::
BuildsController
do
include
ApiHelpers
let
(
:project
)
{
create
(
:empty_project
,
:public
)
}
describe
'GET trace.json'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
let
(
:user
)
{
create
(
:user
)
}
context
'when user is logged in as developer'
do
before
do
project
.
team
<<
[
user
,
:developer
]
sign_in
(
user
)
get_trace
end
it
'traces build log'
do
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
json_response
[
'id'
]).
to
eq
build
.
id
expect
(
json_response
[
'status'
]).
to
eq
build
.
status
end
end
context
'when user is logged in as non member'
do
before
do
sign_in
(
user
)
get_trace
end
it
'traces build log'
do
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
json_response
[
'id'
]).
to
eq
build
.
id
expect
(
json_response
[
'status'
]).
to
eq
build
.
status
end
end
def
get_trace
get
:trace
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
build
.
id
,
format: :json
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