summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorAlex Sanford <alex.sanford1@gmail.com>2016-10-06 22:09:15 -0300
committerAlex Sanford <alex.sanford1@gmail.com>2016-11-01 07:28:22 -0300
commit3c2f40cd39cab63d6bf33e156123cc74aeb0b4a9 (patch)
tree5fc65223a251cab6fdd85789d86f88f9ea881c16 /spec/features
parent458fa667f5273c3a91906c20cb9e580fb6cfaff4 (diff)
downloadgitlab-ce-3c2f40cd39cab63d6bf33e156123cc74aeb0b4a9.tar.gz
Add validation errors to Merge Request form
If source branch or target branch doesn't exist in the project, display form validation errors. Previously, this caused a 500 error code.
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/merge_requests/create_new_mr_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/features/merge_requests/create_new_mr_spec.rb b/spec/features/merge_requests/create_new_mr_spec.rb
index b963d1305b5..c68e1ea4af9 100644
--- a/spec/features/merge_requests/create_new_mr_spec.rb
+++ b/spec/features/merge_requests/create_new_mr_spec.rb
@@ -59,4 +59,12 @@ feature 'Create New Merge Request', feature: true, js: true do
expect(page).to have_css('a.btn.active', text: 'Side-by-side')
end
end
+
+ it 'does not allow non-existing branches' do
+ visit new_namespace_project_merge_request_path(project.namespace, project, merge_request: { target_branch: 'non-exist-target', source_branch: 'non-exist-source' })
+
+ expect(page).to have_content('The form contains the following errors')
+ expect(page).to have_content('Source branch "non-exist-source" does not exist')
+ expect(page).to have_content('Target branch "non-exist-target" does not exist')
+ end
end