Fix regression in Merge request form
Merge request !7163 caused an error message to appear on the Merge Request form when it was first loaded by the user. This commit fixes that regression bug.
This commit is contained in:
parent
cf0283c893
commit
16a8d64429
|
@ -48,11 +48,11 @@ module MergeRequests
|
||||||
end
|
end
|
||||||
|
|
||||||
# See if source and target branches exist
|
# See if source and target branches exist
|
||||||
unless merge_request.source_project.commit(merge_request.source_branch)
|
if merge_request.source_branch.present? && !merge_request.source_project.commit(merge_request.source_branch)
|
||||||
messages << "Source branch \"#{merge_request.source_branch}\" does not exist"
|
messages << "Source branch \"#{merge_request.source_branch}\" does not exist"
|
||||||
end
|
end
|
||||||
|
|
||||||
unless merge_request.target_project.commit(merge_request.target_branch)
|
if merge_request.target_branch.present? && !merge_request.target_project.commit(merge_request.target_branch)
|
||||||
messages << "Target branch \"#{merge_request.target_branch}\" does not exist"
|
messages << "Target branch \"#{merge_request.target_branch}\" does not exist"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Fix regression causing bad error message to appear on Merge Request form
|
||||||
|
merge_request: 7599
|
||||||
|
author: Alex Sanford
|
|
@ -77,4 +77,11 @@ feature 'Create New Merge Request', feature: true, js: true do
|
||||||
expect(page).to have_content "6049019_460s.jpg"
|
expect(page).to have_content "6049019_460s.jpg"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Isolates a regression (see #24627)
|
||||||
|
it 'does not show error messages on initial form' do
|
||||||
|
visit new_namespace_project_merge_request_path(project.namespace, project)
|
||||||
|
expect(page).not_to have_selector('#error_explanation')
|
||||||
|
expect(page).not_to have_content('The form contains the following error')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue