diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2017-09-20 09:39:12 -0500 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-09-20 09:39:12 -0500 |
commit | 9c096ddf28d63a89ff2844514bde9ab93a8756ae (patch) | |
tree | 749069b8452f79a5404c71bebcb8ea0942fd7c34 /spec/features/projects/diffs/diff_show_spec.rb | |
parent | 727f51b8ef0af2b78087b4ac894ee728bfbabd1f (diff) | |
download | gitlab-ce-9c096ddf28d63a89ff2844514bde9ab93a8756ae.tar.gz |
Add view replaced file link for image diffsadd-view-replaced-file-link
Diffstat (limited to 'spec/features/projects/diffs/diff_show_spec.rb')
-rw-r--r-- | spec/features/projects/diffs/diff_show_spec.rb | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/spec/features/projects/diffs/diff_show_spec.rb b/spec/features/projects/diffs/diff_show_spec.rb index a6f52c9ef58..c1307ab640f 100644 --- a/spec/features/projects/diffs/diff_show_spec.rb +++ b/spec/features/projects/diffs/diff_show_spec.rb @@ -62,13 +62,43 @@ feature 'Diff file viewer', :js do end context 'Image file' do - before do - visit_commit('2f63565e7aac07bcdadb654e253078b727143ec4') + context 'Replaced' do + before do + visit_commit('2f63565e7aac07bcdadb654e253078b727143ec4') + end + + it 'shows a rendered image' do + within('.diff-file[id="e986451b8f7397b617dbb6fffcb5539328c56921"]') do + expect(page).to have_css('img[alt="files/images/6049019_460s.jpg"]') + end + end + + it 'shows view replaced and view file links' do + expect(page.all('.file-actions a').length).to eq 2 + expect(page.all('.file-actions a')[0]).to have_content 'View replaced file @' + expect(page.all('.file-actions a')[1]).to have_content 'View file @' + end + end + + context 'Added' do + before do + visit_commit('33f3729a45c02fc67d00adb1b8bca394b0e761d9') + end + + it 'shows view file link' do + expect(page.all('.file-actions a').length).to eq 1 + expect(page.all('.file-actions a')[0]).to have_content 'View file @' + end end - it 'shows a rendered image' do - within('.diff-file[id="e986451b8f7397b617dbb6fffcb5539328c56921"]') do - expect(page).to have_css('img[alt="files/images/6049019_460s.jpg"]') + context 'Deleted' do + before do + visit_commit('7fd7a459706ee87be6f855fd98ce8c552b15529a') + end + + it 'shows view file link' do + expect(page.all('.file-actions a').length).to eq 1 + expect(page.all('.file-actions a')[0]).to have_content 'View file @' end end end |