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
3ec8558c
Commit
3ec8558c
authored
Dec 06, 2018
by
Tetiana Chupryna
Committed by
Kamil Trzciński
Dec 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix managed licences path for fork cases
parent
21f143fc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
1 deletion
+35
-1
ee/app/serializers/ee/merge_request_widget_entity.rb
ee/app/serializers/ee/merge_request_widget_entity.rb
+1
-1
ee/changelogs/unreleased/7757-fix-license-managment-path-for-forks.yml
.../unreleased/7757-fix-license-managment-path-for-forks.yml
+5
-0
ee/spec/serializers/merge_request_widget_entity_spec.rb
ee/spec/serializers/merge_request_widget_entity_spec.rb
+29
-0
No files found.
ee/app/serializers/ee/merge_request_widget_entity.rb
View file @
3ec8558c
...
...
@@ -66,7 +66,7 @@ module EE
end
expose
:managed_licenses_path
do
|
merge_request
|
api_v4_projects_managed_licenses_path
(
id:
merge_request
.
source
_project
.
id
)
api_v4_projects_managed_licenses_path
(
id:
merge_request
.
target
_project
.
id
)
end
expose
:can_manage_licenses
do
|
merge_request
|
...
...
ee/changelogs/unreleased/7757-fix-license-managment-path-for-forks.yml
0 → 100644
View file @
3ec8558c
---
title
:
Fixed license managment path in MR widget for fork cases
merge_request
:
8700
author
:
type
:
fixed
ee/spec/serializers/merge_request_widget_entity_spec.rb
View file @
3ec8558c
require
'spec_helper'
describe
MergeRequestWidgetEntity
do
include
ProjectForksHelper
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
:project
,
:repository
}
set
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
...
...
@@ -150,6 +152,33 @@ describe MergeRequestWidgetEntity do
expect
(
subject
.
as_json
[
:license_management
]).
to
include
(
:license_management_full_report_path
)
end
end
describe
'#managed_licenses_path'
do
let
(
:managed_licenses_path
)
{
api_v4_projects_managed_licenses_path
(
id:
project
.
id
)
}
before
do
create
(
:ee_ci_build
,
:legacy_license_management
,
pipeline:
pipeline
)
end
it
'should be a path for target project'
do
expect
(
subject
.
as_json
[
:license_management
][
:managed_licenses_path
]).
to
eq
(
managed_licenses_path
)
end
context
'with fork'
do
let
(
:source_project
)
{
fork_project
(
project
,
user
,
repository:
true
)
}
let
(
:fork_merge_request
)
{
create
(
:merge_request
,
source_project:
source_project
,
target_project:
project
)
}
let
(
:subject_json
)
{
described_class
.
new
(
fork_merge_request
,
current_user:
user
,
request:
request
).
as_json
}
before
do
allow
(
fork_merge_request
).
to
receive_messages
(
head_pipeline:
pipeline
)
stub_licensed_features
(
license_management:
true
)
end
it
'should be a path for target project'
do
expect
(
subject_json
[
:license_management
][
:managed_licenses_path
]).
to
eq
(
managed_licenses_path
)
end
end
end
end
it
'has vulnerability feedbacks path'
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