From 3fa265d19547669c60788e38e389fa12bb119235 Mon Sep 17 00:00:00 2001 From: Adam Niedzielski Date: Thu, 10 Nov 2016 18:24:12 +0100 Subject: Fix expanding a collapsed diff when converting a symlink to a regular file In this case comparing old_path and new_path is not enough because there are two entires that match. --- spec/features/expand_collapse_diffs_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'spec/features/expand_collapse_diffs_spec.rb') diff --git a/spec/features/expand_collapse_diffs_spec.rb b/spec/features/expand_collapse_diffs_spec.rb index 6c938bdead8..3934c936f20 100644 --- a/spec/features/expand_collapse_diffs_spec.rb +++ b/spec/features/expand_collapse_diffs_spec.rb @@ -182,6 +182,20 @@ feature 'Expand and collapse diffs', js: true, feature: true do end end end + + context 'expanding a diff when symlink was converted to a regular file' do + let(:branch) { 'symlink-expand-diff' } + + it 'shows the content of the regular file' do + expect(page).to have_content('This diff is collapsed') + expect(page).to have_no_content('No longer a symlink') + + find('.click-to-expand').click + wait_for_ajax + + expect(page).to have_content('No longer a symlink') + end + end end context 'visiting a commit without collapsed diffs' do -- cgit v1.2.1