BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
831b9335
Commit
831b9335
authored
Feb 05, 2017
by
Jarka Kadlecova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MR widget url
parent
4d11903d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
merge_requests_helper.rb
app/helpers/merge_requests_helper.rb
+2
-2
27632_fix_mr_widget_url.yml
changelogs/unreleased/27632_fix_mr_widget_url.yml
+4
-0
merge_requests_helper_spec.rb
spec/helpers/merge_requests_helper_spec.rb
+6
-4
No files found.
app/helpers/merge_requests_helper.rb
View file @
831b9335
...
@@ -20,8 +20,8 @@ module MergeRequestsHelper
...
@@ -20,8 +20,8 @@ module MergeRequestsHelper
end
end
def
mr_widget_refresh_url
(
mr
)
def
mr_widget_refresh_url
(
mr
)
if
mr
&&
mr
.
source
_project
if
mr
&&
mr
.
target
_project
merge_widget_refresh_namespace_project_merge_request_url
(
mr
.
source_project
.
namespace
,
mr
.
source
_project
,
mr
)
merge_widget_refresh_namespace_project_merge_request_url
(
mr
.
target_project
.
namespace
,
mr
.
target
_project
,
mr
)
else
else
''
''
end
end
...
...
changelogs/unreleased/27632_fix_mr_widget_url.yml
0 → 100644
View file @
831b9335
---
title
:
Fix MR widget url
merge_request
:
8989
author
:
spec/helpers/merge_requests_helper_spec.rb
View file @
831b9335
...
@@ -63,9 +63,11 @@ describe MergeRequestsHelper do
...
@@ -63,9 +63,11 @@ describe MergeRequestsHelper do
end
end
end
end
describe
'mr_widget_refresh_url'
do
describe
'#mr_widget_refresh_url'
do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:guest
)
{
create
(
:user
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project_fork
)
{
Projects
::
ForkService
.
new
(
project
,
guest
).
execute
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project_fork
,
target_project:
project
)
}
it
'returns correct url for MR'
do
it
'returns correct url for MR'
do
expected_url
=
"
#{
project
.
path_with_namespace
}
/merge_requests/
#{
merge_request
.
iid
}
/merge_widget_refresh"
expected_url
=
"
#{
project
.
path_with_namespace
}
/merge_requests/
#{
merge_request
.
iid
}
/merge_widget_refresh"
...
@@ -74,7 +76,7 @@ describe MergeRequestsHelper do
...
@@ -74,7 +76,7 @@ describe MergeRequestsHelper do
end
end
it
'returns empty string for nil'
do
it
'returns empty string for nil'
do
expect
(
mr_widget_refresh_url
(
nil
)).
to
e
nd_with
(
''
)
expect
(
mr_widget_refresh_url
(
nil
)).
to
e
q
(
''
)
end
end
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