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
Léo-Paul Géneau
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
spec/helpers/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