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
394b57bc
Commit
394b57bc
authored
Mar 02, 2021
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose boolean predicate methods in API
parent
0b6d6f9d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
4 deletions
+30
-4
changelogs/unreleased/290254-override-approvers-setting-does-not-reflect-actual-behavior.yml
...de-approvers-setting-does-not-reflect-actual-behavior.yml
+5
-0
ee/lib/ee/api/entities/approval_settings.rb
ee/lib/ee/api/entities/approval_settings.rb
+13
-4
ee/spec/requests/api/project_approvals_spec.rb
ee/spec/requests/api/project_approvals_spec.rb
+12
-0
No files found.
changelogs/unreleased/290254-override-approvers-setting-does-not-reflect-actual-behavior.yml
0 → 100644
View file @
394b57bc
---
title
:
Ensure Project Approvals API casts to boolean
merge_request
:
55492
author
:
type
:
fixed
ee/lib/ee/api/entities/approval_settings.rb
View file @
394b57bc
...
...
@@ -7,11 +7,20 @@ module EE
expose
:approvers
,
using:
EE
::
API
::
Entities
::
Approver
expose
:approver_groups
,
using:
EE
::
API
::
Entities
::
ApproverGroup
expose
:approvals_before_merge
expose
:reset_approvals_on_push
expose
:disable_overriding_approvers_per_merge_request
expose
:merge_requests_author_approval
expose
:merge_requests_disable_committers_approval
expose
:require_password_to_approve
expose
:disable_overriding_approvers_per_merge_request?
,
as: :disable_overriding_approvers_per_merge_request
expose
:merge_requests_author_approval?
,
as: :merge_requests_author_approval
expose
:merge_requests_disable_committers_approval?
,
as: :merge_requests_disable_committers_approval
expose
:require_password_to_approve?
,
as: :require_password_to_approve
end
end
end
...
...
ee/spec/requests/api/project_approvals_spec.rb
View file @
394b57bc
...
...
@@ -20,6 +20,18 @@ RSpec.describe API::ProjectApprovals do
get
api
(
url
,
user
)
end
it
'does not return null values for unmodified boolean fields'
do
expect
(
project
.
disable_overriding_approvers_per_merge_request
).
to
be_nil
expect
(
project
.
merge_requests_author_approval
).
to
be_nil
expect
(
project
.
merge_requests_disable_committers_approval
).
to
be_nil
expect
(
project
.
require_password_to_approve
).
to
be_nil
expect
(
json_response
[
"disable_overriding_approvers_per_merge_request"
]).
to
be
false
expect
(
json_response
[
"merge_requests_author_approval"
]).
to
be
false
expect
(
json_response
[
"merge_requests_disable_committers_approval"
]).
to
be
false
expect
(
json_response
[
"require_password_to_approve"
]).
to
be
false
end
it
'returns 200 status'
do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
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