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
5cfe33c0
Commit
5cfe33c0
authored
Feb 01, 2019
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow anyone to approve if no rule exists
Update spec
parent
a162503e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
ee/app/models/approval_state.rb
ee/app/models/approval_state.rb
+1
-1
ee/spec/models/approval_state_spec.rb
ee/spec/models/approval_state_spec.rb
+21
-9
No files found.
ee/app/models/approval_state.rb
View file @
5cfe33c0
...
...
@@ -65,7 +65,7 @@ class ApprovalState
end
def
any_approver_allowed?
approved?
regular_rules
.
empty?
||
approved?
end
def
approvals_required
...
...
ee/spec/models/approval_state_spec.rb
View file @
5cfe33c0
...
...
@@ -189,6 +189,17 @@ describe ApprovalState do
end
describe
'#any_approver_allowed?'
do
context
'when no rules'
do
it
'returns true'
do
expect
(
subject
.
any_approver_allowed?
).
to
eq
(
true
)
end
end
context
'when with rules'
do
before
do
create_rule
(
approvals_required:
1
,
users:
[
approver1
])
end
context
'when approved'
do
before
do
allow
(
subject
).
to
receive
(
:approved?
).
and_return
(
true
)
...
...
@@ -209,6 +220,7 @@ describe ApprovalState do
end
end
end
end
describe
'#approvals_left'
do
before
do
...
...
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