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
07a4a381
Commit
07a4a381
authored
May 07, 2021
by
Serena Fang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose is_auditor if auditor user available
parent
be295ce3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
ee/lib/ee/api/entities/user_with_admin.rb
ee/lib/ee/api/entities/user_with_admin.rb
+1
-1
ee/spec/lib/ee/api/entities/user_with_admin_spec.rb
ee/spec/lib/ee/api/entities/user_with_admin_spec.rb
+18
-6
No files found.
ee/lib/ee/api/entities/user_with_admin.rb
View file @
07a4a381
...
...
@@ -8,7 +8,7 @@ module EE
prepended
do
expose
:using_license_seat?
,
as: :using_license_seat
expose
:auditor
,
as: :is_auditor
expose
:auditor
,
as: :is_auditor
,
if:
->
(
_instance
,
_opts
)
{
::
License
.
feature_available?
(
:auditor_user
)
}
end
end
end
...
...
ee/spec/lib/ee/api/entities/user_with_admin_spec.rb
View file @
07a4a381
...
...
@@ -25,15 +25,27 @@ RSpec.describe ::EE::API::Entities::UserWithAdmin do
end
context
'is_auditor'
do
it
'returns false when user is not an auditor'
do
expect
(
subject
[
:is_auditor
]).
to
be
false
context
'when auditor_user is available'
do
it
'returns false when user is not an auditor'
do
expect
(
subject
[
:is_auditor
]).
to
be
false
end
context
'when user is an auditor'
do
let
(
:user
)
{
create
(
:user
,
:auditor
)
}
it
'returns true'
do
expect
(
subject
[
:is_auditor
]).
to
be
true
end
end
end
context
'when user is an auditor'
do
let
(
:user
)
{
create
(
:user
,
:auditor
)
}
context
'when auditor_user is not available'
do
before
do
stub_licensed_features
(
auditor_user:
false
)
end
it
'
returns true
'
do
expect
(
subject
[
:is_auditor
]).
to
be
true
it
'
does not have the is_auditor param
'
do
expect
(
subject
[
:is_auditor
]).
to
be
nil
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