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
3d317f30
Commit
3d317f30
authored
Dec 05, 2019
by
mo khan
Committed by
Ash McKenzie
Dec 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update serialization of ManagedLicenseEntity
parent
826f9186
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
ee/app/serializers/managed_license_entity.rb
ee/app/serializers/managed_license_entity.rb
+4
-1
ee/spec/serializers/managed_license_entity_spec.rb
ee/spec/serializers/managed_license_entity_spec.rb
+15
-0
No files found.
ee/app/serializers/managed_license_entity.rb
View file @
3d317f30
...
...
@@ -2,7 +2,10 @@
class
ManagedLicenseEntity
<
Grape
::
Entity
expose
:id
expose
:classification
,
as: :approval_status
expose
:classification
,
as: :approval_status
do
|
policy
|
SoftwareLicensePolicy
::
APPROVAL_STATUS
.
key
(
policy
.
classification
)
||
policy
.
classification
end
expose
:software_license
,
merge:
true
do
expose
:name
end
...
...
ee/spec/serializers/managed_license_entity_spec.rb
View file @
3d317f30
...
...
@@ -12,5 +12,20 @@ describe ManagedLicenseEntity do
it
'contains required fields'
do
expect
(
subject
).
to
include
(
:id
,
:name
,
:approval_status
)
end
describe
"#approval_status"
do
where
(
:classification
,
:approval_status
)
do
[
[
'approved'
,
'approved'
],
[
'denied'
,
'blacklisted'
]
]
end
with_them
do
let
(
:software_license_policy
)
{
build
(
:software_license_policy
,
classification:
classification
)
}
it
{
expect
(
subject
[
:approval_status
]).
to
eql
(
approval_status
)
}
end
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