diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-20 09:24:38 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-20 09:24:38 +0000 |
commit | 898e2cc1dfa88b4ac39cb4b35011f61b37f57b51 (patch) | |
tree | c6524edb6c9a43cccf93be05c36883fde1a53ee4 /spec/services | |
parent | b5571e6e22cdacc81f78eff5943d68c8ba220fbb (diff) | |
download | gitlab-ce-898e2cc1dfa88b4ac39cb4b35011f61b37f57b51.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/notification_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/projects/update_pages_service_spec.rb | 48 |
2 files changed, 5 insertions, 45 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index b80f75c70e6..5440a42348e 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -2707,7 +2707,7 @@ describe NotificationService, :mailer do # User to be participant by default # This user does not contain any record in notification settings table # It should be treated with a :participating notification_level - @u_lazy_participant = create(:user, username: 'lazy-participant') + @u_lazy_participant = create(:user, username: 'lazy-participant') @u_guest_watcher = create_user_with_notification(:watch, 'guest_watching') @u_guest_custom = create_user_with_notification(:custom, 'guest_custom') diff --git a/spec/services/projects/update_pages_service_spec.rb b/spec/services/projects/update_pages_service_spec.rb index fe92b53cd91..9aa8c7f85ca 100644 --- a/spec/services/projects/update_pages_service_spec.rb +++ b/spec/services/projects/update_pages_service_spec.rb @@ -185,60 +185,20 @@ describe Projects::UpdatePagesService do .and_return(metadata) end - shared_examples 'pages size limit exceeded' do - it 'limits the maximum size of gitlab pages' do - subject.execute - - expect(deploy_status.description) - .to match(/artifacts for pages are too large/) - expect(deploy_status).to be_script_failure - expect(project.pages_metadatum).not_to be_deployed - end - end - context 'when maximum pages size is set to zero' do before do stub_application_setting(max_pages_size: 0) end - context 'when page size does not exceed internal maximum' do - before do - allow(metadata).to receive(:total_size).and_return(200.megabytes) - end - - it 'updates pages correctly' do - subject.execute - - expect(deploy_status.description).not_to be_present - expect(project.pages_metadatum).to be_deployed - end - end - - context 'when pages size does exceed internal maximum' do - before do - allow(metadata).to receive(:total_size).and_return(2.terabytes) - end - - it_behaves_like 'pages size limit exceeded' - end - end - - context 'when pages size is greater than max size setting' do - before do - stub_application_setting(max_pages_size: 200) - allow(metadata).to receive(:total_size).and_return(201.megabytes) - end - - it_behaves_like 'pages size limit exceeded' + it_behaves_like 'pages size limit is', ::Gitlab::Pages::MAX_SIZE end - context 'when max size setting is greater than internal max size' do + context 'when size is limited on the instance level' do before do - stub_application_setting(max_pages_size: 3.terabytes / 1.megabyte) - allow(metadata).to receive(:total_size).and_return(2.terabytes) + stub_application_setting(max_pages_size: 100) end - it_behaves_like 'pages size limit exceeded' + it_behaves_like 'pages size limit is', 100.megabytes end end |