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
6904814b
Commit
6904814b
authored
Feb 23, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-git-access-specs' into 'master'
Fix GitAccess specs Closes #28620 See merge request !9479
parents
62829b6b
485ac922
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+14
-5
No files found.
spec/lib/gitlab/git_access_spec.rb
View file @
6904814b
...
@@ -199,7 +199,9 @@ describe Gitlab::GitAccess, lib: true do
...
@@ -199,7 +199,9 @@ describe Gitlab::GitAccess, lib: true do
def
stub_git_hooks
def
stub_git_hooks
# Running the `pre-receive` hook is expensive, and not necessary for this test.
# Running the `pre-receive` hook is expensive, and not necessary for this test.
allow_any_instance_of
(
GitHooksService
).
to
receive
(
:execute
).
and_yield
allow_any_instance_of
(
GitHooksService
).
to
receive
(
:execute
)
do
|
service
,
&
block
|
block
.
call
(
service
)
end
end
end
def
merge_into_protected_branch
def
merge_into_protected_branch
...
@@ -232,11 +234,18 @@ describe Gitlab::GitAccess, lib: true do
...
@@ -232,11 +234,18 @@ describe Gitlab::GitAccess, lib: true do
else
else
project
.
team
<<
[
user
,
role
]
project
.
team
<<
[
user
,
role
]
end
end
end
permissions_matrix
[
role
].
each
do
|
action
,
allowed
|
permissions_matrix
[
role
].
each
do
|
action
,
allowed
|
context
action
do
context
action
do
subject
{
access
.
send
(
:check_push_access!
,
changes
[
action
])
}
subject
{
access
.
send
(
:check_push_access!
,
changes
[
action
])
}
it
{
expect
(
subject
.
allowed?
).
to
allowed
?
be_truthy
:
be_falsey
}
it
do
if
allowed
expect
{
subject
}.
not_to
raise_error
else
expect
{
subject
}.
to
raise_error
(
Gitlab
::
GitAccess
::
UnauthorizedError
)
end
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