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
aa395954
Commit
aa395954
authored
Jul 31, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix branch API tests, by moving to correct context
parent
adc742cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
spec/requests/api/branches_spec.rb
spec/requests/api/branches_spec.rb
+9
-9
No files found.
spec/requests/api/branches_spec.rb
View file @
aa395954
...
...
@@ -313,18 +313,18 @@ describe API::Branches do
expect
(
json_response
[
'developers_can_merge'
]).
to
eq
(
true
)
end
end
end
context
"when no one can push"
do
let
(
:protected_branch
)
{
create
(
:protected_branch
,
:no_one_can_push
,
project:
project
,
name:
'protected_branch'
)
}
context
"when no one can push"
do
let
(
:protected_branch
)
{
create
(
:protected_branch
,
:no_one_can_push
,
project:
project
,
name:
'protected_branch'
)
}
it
"updates 'developers_can_push' without removing the 'no_one' access level"
do
put
api
(
"/projects/
#{
project
.
id
}
/repository/branches/
#{
protected_branch
.
name
}
/protect"
,
user
),
developers_can_push:
true
,
developers_can_merge:
true
it
"updates 'developers_can_push' without removing the 'no_one' access level"
do
put
api
(
"/projects/
#{
project
.
id
}
/repository/branches/
#{
protected_branch
.
name
}
/protect"
,
user
),
developers_can_push:
true
,
developers_can_merge:
true
expect
(
response
).
to
have_http_status
(
200
)
expect
(
json_response
[
'name'
]).
to
eq
(
protected_branch
.
name
)
expect
(
protected_branch
.
reload
.
push_access_levels
.
pluck
(
:access_level
)).
to
include
(
Gitlab
::
Access
::
NO_ACCESS
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'name'
]).
to
eq
(
protected_branch
.
name
)
expect
(
protected_branch
.
reload
.
push_access_levels
.
pluck
(
:access_level
)).
to
include
(
Gitlab
::
Access
::
NO_ACCESS
)
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