mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-11 13:46:11 +10:00
Merge branch 'issue_4189' into 'master'
Fix redirect to wrong URL when merging and MR detail URL has an anchor. Closes #4189 See merge request !2169
This commit is contained in:
@@ -18,7 +18,7 @@ class @MergeRequestWidget
|
||||
if data.state == "merged"
|
||||
urlSuffix = if deleteSourceBranch then '?delete_source=true' else ''
|
||||
|
||||
window.location.href = window.location.href + urlSuffix
|
||||
window.location.href = window.location.pathname + urlSuffix
|
||||
else if data.merge_error
|
||||
$('.mr-widget-body').html("<h4>" + data.merge_error + "</h4>")
|
||||
else
|
||||
|
||||
@@ -12,6 +12,14 @@ Feature: Project Merge Requests Acceptance
|
||||
Then I should see merge request merged
|
||||
And I should not see the Remove Source Branch button
|
||||
|
||||
@javascript
|
||||
Scenario: Accepting the Merge Request when URL has an anchor
|
||||
Given I am on the Merge Request detail with note anchor page
|
||||
When I click on "Remove source branch" option
|
||||
And I click on Accept Merge Request
|
||||
Then I should see merge request merged
|
||||
And I should not see the Remove Source Branch button
|
||||
|
||||
@javascript
|
||||
Scenario: Accepting the Merge Request without removing the source branch
|
||||
Given I am on the Merge Request detail page
|
||||
|
||||
@@ -6,6 +6,10 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps
|
||||
visit merge_request_path(@merge_request)
|
||||
end
|
||||
|
||||
step 'I am on the Merge Request detail with note anchor page' do
|
||||
visit merge_request_path(@merge_request, anchor: 'note_123')
|
||||
end
|
||||
|
||||
step 'I click on "Remove source branch" option' do
|
||||
check('Remove source branch')
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user