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
274d9a74
Commit
274d9a74
authored
Aug 17, 2020
by
Robert May
Committed by
Igor Drozdov
Aug 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix commented_by for any approver rule
Fixes
https://gitlab.com/gitlab-org/gitlab/-/issues/235884
.
parent
4dddd904
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
ee/app/models/approval_wrapped_any_approver_rule.rb
ee/app/models/approval_wrapped_any_approver_rule.rb
+8
-0
ee/changelogs/unreleased/commented-by-4.yml
ee/changelogs/unreleased/commented-by-4.yml
+5
-0
ee/spec/models/approval_wrapped_any_approver_rule_spec.rb
ee/spec/models/approval_wrapped_any_approver_rule_spec.rb
+14
-0
No files found.
ee/app/models/approval_wrapped_any_approver_rule.rb
View file @
274d9a74
...
...
@@ -15,4 +15,12 @@ class ApprovalWrappedAnyApproverRule < ApprovalWrappedRule
approvals_left
<=
0
end
end
def
commented_approvers
strong_memoize
(
:commented_approvers
)
do
merge_request
.
note_authors
.
select
do
|
user
|
merge_request
.
can_approve?
(
user
)
end
end
end
end
ee/changelogs/unreleased/commented-by-4.yml
0 → 100644
View file @
274d9a74
---
title
:
Fix commented_by for any approvers rule
merge_request
:
39432
author
:
type
:
fixed
ee/spec/models/approval_wrapped_any_approver_rule_spec.rb
View file @
274d9a74
...
...
@@ -47,4 +47,18 @@ RSpec.describe ApprovalWrappedAnyApproverRule do
it
'#approved?'
do
expect
(
subject
.
approved?
).
to
eq
(
true
)
end
describe
"#commented_approvers"
do
it
"returns an array"
do
expect
(
subject
.
commented_approvers
).
to
be_an
(
Array
)
end
it
"returns an array of approvers who have commented"
do
create
(
:note
,
project:
merge_request
.
project
,
noteable:
merge_request
,
author:
approver1
)
allow
(
merge_request
).
to
receive
(
:can_approve?
).
with
(
approver1
).
and_return
(
true
)
expect
(
subject
.
commented_approvers
).
to
eq
([
approver1
])
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