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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
ba962aa3
Commit
ba962aa3
authored
Jul 21, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup the use of let, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5347#note_13202424
parent
01dcb5c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
spec/requests/api/builds_spec.rb
spec/requests/api/builds_spec.rb
+6
-8
No files found.
spec/requests/api/builds_spec.rb
View file @
ba962aa3
...
...
@@ -5,12 +5,10 @@ describe API::API, api: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:api_user
)
{
user
}
let
(
:reporter_user
)
{
create
(
:user
)
}
let
(
:guest_user
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:developer
)
{
create
(
:project_member
,
:developer
,
user:
user
,
project:
project
)
}
let
!
(
:reporter
)
{
create
(
:project_member
,
:reporter
,
user:
reporter_us
er
,
project:
project
)
}
let
!
(
:guest
)
{
create
(
:project_member
,
:guest
,
user:
guest_user
,
project:
project
)
}
let
(
:reporter
)
{
create
(
:project_member
,
:report
er
,
project:
project
)
}
let
(
:guest
)
{
create
(
:project_member
,
:guest
,
project:
project
)
}
let!
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
.
id
,
ref:
project
.
default_branch
)
}
let!
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
...
...
@@ -175,7 +173,7 @@ describe API::API, api: true do
end
describe
'GET /projects/:id/artifacts/:ref_name/download?job=name'
do
let
(
:api_user
)
{
reporter
_
user
}
let
(
:api_user
)
{
reporter
.
user
}
let
(
:build
)
{
create
(
:ci_build
,
:success
,
:artifacts
,
pipeline:
pipeline
)
}
def
path_for_ref
(
ref
=
pipeline
.
ref
,
job
=
build
.
name
)
...
...
@@ -195,7 +193,7 @@ describe API::API, api: true do
end
context
'when logging as guest'
do
let
(
:api_user
)
{
guest
_
user
}
let
(
:api_user
)
{
guest
.
user
}
before
do
get
path_for_ref
...
...
@@ -301,7 +299,7 @@ describe API::API, api: true do
end
context
'user without :update_build permission'
do
let
(
:api_user
)
{
reporter
_
user
}
let
(
:api_user
)
{
reporter
.
user
}
it
'should not cancel build'
do
expect
(
response
).
to
have_http_status
(
403
)
...
...
@@ -333,7 +331,7 @@ describe API::API, api: true do
end
context
'user without :update_build permission'
do
let
(
:api_user
)
{
reporter
_
user
}
let
(
:api_user
)
{
reporter
.
user
}
it
'should not retry build'
do
expect
(
response
).
to
have_http_status
(
403
)
...
...
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