summaryrefslogtreecommitdiff
path: root/spec/features/merge_requests
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-08-27 20:59:48 -0700
committerRémy Coutable <remy@rymai.me>2016-11-14 15:57:01 +0100
commit0f61bb2dc5298a7e06f8e211adcf46dd282b9c86 (patch)
tree3e5d555919ae02c30bb8519cc898d8a256f75e9a /spec/features/merge_requests
parent36fa5d660df96c49484cd27695da1df6e361eb8f (diff)
downloadgitlab-ce-0f61bb2dc5298a7e06f8e211adcf46dd282b9c86.tar.gz
Fix Error 500 when creating a merge request that contains an image that was deleted and addedstanhu/gitlab-ce-fix-error-500-with-mr-images
Steps to reproduce: 1. Start with a repo with an image 2. Add a commit to delete the image 3. Add another commit to replace the image with another image In a diff comparison, we really just compare about what the image was before the diff, not the direct parent of the last commit. This MR fixes that. Closes #3893, gitlab-org/gitlab-ee#678 Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/features/merge_requests')
-rw-r--r--spec/features/merge_requests/create_new_mr_spec.rb10
1 files changed, 10 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 c68e1ea4af9..584574cc91a 100644
--- a/spec/features/merge_requests/create_new_mr_spec.rb
+++ b/spec/features/merge_requests/create_new_mr_spec.rb
@@ -67,4 +67,14 @@ feature 'Create New Merge Request', feature: true, js: true do
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
+
+ context 'when a branch contains commits that both delete and add the same image' do
+ it 'renders the diff successfully' do
+ visit new_namespace_project_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: 'deleted-image-test' })
+
+ click_link "Changes"
+
+ expect(page).to have_content "6049019_460s.jpg"
+ end
+ end
end