Commit 7a65cb3a authored by Douwe Maan's avatar Douwe Maan

Don't reset target branch when choosing to "Change branches" in MR

parent e3233016
...@@ -49,8 +49,9 @@ module MergeRequestsHelper ...@@ -49,8 +49,9 @@ module MergeRequestsHelper
source_project_id: @merge_request.source_project_id, source_project_id: @merge_request.source_project_id,
target_project_id: @merge_request.target_project_id, target_project_id: @merge_request.target_project_id,
source_branch: @merge_request.source_branch, source_branch: @merge_request.source_branch,
target_branch: nil target_branch: @merge_request.target_branch,
} },
change_branches: true
) )
end end
......
- page_title "New Merge Request" - page_title "New Merge Request"
= render "header_title" = render "header_title"
- if @merge_request.can_be_created - if @merge_request.can_be_created && !params[:change_branches]
= render 'new_submit' = render 'new_submit'
- else - else
= render 'new_compare' = render 'new_compare'
...@@ -112,7 +112,6 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps ...@@ -112,7 +112,6 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
end end
step 'I fill out an invalid "Merge Request On Forked Project" merge request' do step 'I fill out an invalid "Merge Request On Forked Project" merge request' do
select "Select branch", from: "merge_request_target_branch"
expect(find(:select, "merge_request_source_project_id", {}).value).to eq @forked_project.id.to_s expect(find(:select, "merge_request_source_project_id", {}).value).to eq @forked_project.id.to_s
expect(find(:select, "merge_request_target_project_id", {}).value).to eq @project.id.to_s expect(find(:select, "merge_request_target_project_id", {}).value).to eq @project.id.to_s
expect(find(:select, "merge_request_source_branch", {}).value).to eq "" expect(find(:select, "merge_request_source_branch", {}).value).to eq ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment