BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
1c3b3fac
Commit
1c3b3fac
authored
Aug 25, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for new visibility_level_helper methods
parent
aff72ece
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
visibility_level_helper_spec.rb
spec/helpers/visibility_level_helper_spec.rb
+26
-0
No files found.
spec/helpers/visibility_level_helper_spec.rb
View file @
1c3b3fac
...
@@ -111,4 +111,30 @@ describe VisibilityLevelHelper do
...
@@ -111,4 +111,30 @@ describe VisibilityLevelHelper do
end
end
end
end
end
end
describe
"disallowed_visibility_level_description"
do
let
(
:group
)
{
create
(
:group
,
:internal
)
}
let!
(
:subgroup
)
{
create
(
:group
,
:internal
,
parent:
group
)
}
let!
(
:project
)
{
create
(
:project
,
:internal
,
group:
group
)
}
describe
"project"
do
it
"provides correct description for disabled levels"
do
expect
(
disallowed_visibility_level?
(
project
,
Gitlab
::
VisibilityLevel
::
PUBLIC
)).
to
be_truthy
expect
(
disallowed_visibility_level_description
(
Gitlab
::
VisibilityLevel
::
PUBLIC
,
project
))
.
to
include
"the visibility of
#{
project
.
group
.
name
}
is internal"
end
end
describe
"group"
do
it
"provides correct description for disabled levels"
do
expect
(
disallowed_visibility_level?
(
group
,
Gitlab
::
VisibilityLevel
::
PRIVATE
)).
to
be_truthy
expect
(
disallowed_visibility_level_description
(
Gitlab
::
VisibilityLevel
::
PRIVATE
,
group
))
.
to
include
"it contains projects with higher visibility"
,
"it contains sub-groups with higher visibility"
expect
(
disallowed_visibility_level?
(
subgroup
,
Gitlab
::
VisibilityLevel
::
PUBLIC
)).
to
be_truthy
expect
(
disallowed_visibility_level_description
(
Gitlab
::
VisibilityLevel
::
PUBLIC
,
subgroup
))
.
to
include
"the visibility of its parent group is internal"
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