diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-23 09:08:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-23 09:08:58 +0000 |
commit | 17f2e5035c716bccb6bd7073215e9b2d449184e7 (patch) | |
tree | fc64f81713efe4d097d454ccf5f1a691d7b09165 /spec/features/projects/blobs | |
parent | 48720d9da0a148c8a7886351162bbf0413ed492e (diff) | |
download | gitlab-ce-17f2e5035c716bccb6bd7073215e9b2d449184e7.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/projects/blobs')
-rw-r--r-- | spec/features/projects/blobs/blame_spec.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/features/projects/blobs/blame_spec.rb b/spec/features/projects/blobs/blame_spec.rb index 4e422786f36..3b2b74b469e 100644 --- a/spec/features/projects/blobs/blame_spec.rb +++ b/spec/features/projects/blobs/blame_spec.rb @@ -70,4 +70,37 @@ RSpec.describe 'File blame', :js do end end end + + context 'when blob length is over global max page limit' do + before do + stub_const('Projects::BlameService::PER_PAGE', 200) + end + + let(:path) { 'files/markdown/ruby-style-guide.md' } + + it 'displays two hundred lines of the file with pagination' do + visit_blob_blame(path) + + expect(page).to have_css('.blame-commit') + expect(page).to have_css('.gl-pagination') + + expect(page).to have_css('#L1') + expect(page).not_to have_css('#L201') + expect(find('.page-link.active')).to have_text('1') + end + + context 'when user clicks on the next button' do + before do + visit_blob_blame(path) + + find('.js-next-button').click + end + + it 'displays next two hundred lines of the file with pagination' do + expect(page).not_to have_css('#L1') + expect(page).to have_css('#L201') + expect(find('.page-link.active')).to have_text('2') + end + end + end end |