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
99f05339
Commit
99f05339
authored
Mar 06, 2017
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix milestone specs and group policy
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
f5ea25aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
35 deletions
+33
-35
app/policies/group_policy.rb
app/policies/group_policy.rb
+6
-7
spec/features/projects/milestones/milestone_spec.rb
spec/features/projects/milestones/milestone_spec.rb
+27
-28
No files found.
app/policies/group_policy.rb
View file @
99f05339
...
...
@@ -34,6 +34,12 @@ class GroupPolicy < BasePolicy
if
globally_viewable
&&
@subject
.
request_access_enabled
&&
!
member
can!
:request_access
end
# EE-only
if
@subject
.
ldap_synced?
cannot!
:admin_group_member
can!
:override_group_member
if
master
end
end
def
can_read_group?
...
...
@@ -45,11 +51,4 @@ class GroupPolicy < BasePolicy
GroupProjectsFinder
.
new
(
@subject
).
execute
(
@user
).
any?
end
def
additional_rules!
(
master
)
if
@subject
.
ldap_synced?
cannot!
:admin_group_member
can!
:override_group_member
if
master
end
end
end
spec/features/projects/milestones/milestone_spec.rb
View file @
99f05339
...
...
@@ -9,33 +9,6 @@ feature 'Project milestone', :feature do
login_as
(
user
)
end
context
'milestone summary'
do
let
(
:project
)
{
create
(
:empty_project
,
:public
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
it
'shows the total weight when sum is greater than zero'
do
create
(
:issue
,
project:
project
,
milestone:
milestone
,
weight:
3
)
create
(
:issue
,
project:
project
,
milestone:
milestone
,
weight:
1
)
visit
milestone_path
within
'.milestone-summary'
do
expect
(
page
).
to
have_content
'Total weight: 4'
end
end
it
'hides the total weight when sum is equal to zero'
do
create
(
:issue
,
project:
project
,
milestone:
milestone
,
weight:
nil
)
create
(
:issue
,
project:
project
,
milestone:
milestone
,
weight:
nil
)
visit
milestone_path
within
'.milestone-summary'
do
expect
(
page
).
not_to
have_content
'Total weight:'
end
end
end
context
'when project has enabled issues'
do
before
do
visit
milestone_path
...
...
@@ -89,7 +62,33 @@ feature 'Project milestone', :feature do
end
end
# EE-only
context
'milestone summary'
do
it
'shows the total weight when sum is greater than zero'
do
create
(
:issue
,
project:
project
,
milestone:
milestone
,
weight:
3
)
create
(
:issue
,
project:
project
,
milestone:
milestone
,
weight:
1
)
visit
milestone_path
within
'.milestone-summary'
do
expect
(
page
).
to
have_content
'Total weight: 4'
end
end
it
'hides the total weight when sum is equal to zero'
do
create
(
:issue
,
project:
project
,
milestone:
milestone
,
weight:
nil
)
create
(
:issue
,
project:
project
,
milestone:
milestone
,
weight:
nil
)
visit
milestone_path
within
'.milestone-summary'
do
expect
(
page
).
not_to
have_content
'Total weight:'
end
end
end
# EE-only
def
milestone_path
visit
namespace_project_milestone_path
(
project
.
namespace
,
project
,
milestone
)
namespace_project_milestone_path
(
project
.
namespace
,
project
,
milestone
)
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