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
Tatuya Kamada
gitlab-ce
Commits
e7d79477
Commit
e7d79477
authored
Nov 29, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve Gitlab::GitAccessWiki spec with download access checks
parent
42c33268
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
spec/lib/gitlab/git_access_wiki_spec.rb
spec/lib/gitlab/git_access_wiki_spec.rb
+25
-0
No files found.
spec/lib/gitlab/git_access_wiki_spec.rb
View file @
e7d79477
...
...
@@ -26,4 +26,29 @@ describe Gitlab::GitAccessWiki, lib: true do
def
changes
[
'6f6d7e7ed 570e7b2ab refs/heads/master'
]
end
describe
'#download_access_check'
do
subject
{
access
.
check
(
'git-upload-pack'
,
'_any'
)
}
before
do
project
.
team
<<
[
user
,
:developer
]
end
context
'when wiki feature is enabled'
do
it
'give access to download wiki code'
do
project
.
project_feature
.
update_attribute
(
:wiki_access_level
,
ProjectFeature
::
ENABLED
)
expect
(
subject
.
allowed?
).
to
be_truthy
end
end
context
'when wiki feature is disabled'
do
it
'does not give access to download wiki code'
do
project
.
project_feature
.
update_attribute
(
:wiki_access_level
,
ProjectFeature
::
DISABLED
)
expect
(
subject
.
allowed?
).
to
be_falsey
expect
(
subject
.
message
).
to
match
(
/You are not allowed to download code/
)
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