summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-10 15:09:22 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-10 15:09:22 +0000
commit37140013714814d8ffe662a372697c56eea2fde0 (patch)
treeb25c0bfc62da359f97b8b3742007c07723242f93 /spec/services
parent948023c9c900344aa1e2f334bcaae5a194873b0d (diff)
downloadgitlab-ce-37140013714814d8ffe662a372697c56eea2fde0.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/ci/create_pipeline_service/rate_limit_spec.rb1
-rw-r--r--spec/services/projects/update_pages_service_spec.rb19
2 files changed, 20 insertions, 0 deletions
diff --git a/spec/services/ci/create_pipeline_service/rate_limit_spec.rb b/spec/services/ci/create_pipeline_service/rate_limit_spec.rb
index fbd8b41de63..0000296230f 100644
--- a/spec/services/ci/create_pipeline_service/rate_limit_spec.rb
+++ b/spec/services/ci/create_pipeline_service/rate_limit_spec.rb
@@ -11,6 +11,7 @@ RSpec.describe Ci::CreatePipelineService, :freeze_time, :clean_gitlab_redis_rate
before do
stub_ci_pipeline_yaml_file(gitlab_ci_yaml)
stub_application_setting(pipeline_limit_per_project_user_sha: 1)
+ stub_feature_flags(ci_enforce_throttle_pipelines_creation_override: false)
end
context 'when user is under the limit' do
diff --git a/spec/services/projects/update_pages_service_spec.rb b/spec/services/projects/update_pages_service_spec.rb
index 777162b6196..cbbed82aa0b 100644
--- a/spec/services/projects/update_pages_service_spec.rb
+++ b/spec/services/projects/update_pages_service_spec.rb
@@ -205,6 +205,25 @@ RSpec.describe Projects::UpdatePagesService do
include_examples 'fails with outdated reference message'
end
end
+
+ context 'when uploaded deployment size is wrong' do
+ it 'raises an error' do
+ allow_next_instance_of(PagesDeployment) do |deployment|
+ allow(deployment)
+ .to receive(:size)
+ .and_return(file.size + 1)
+ end
+
+ expect do
+ expect(execute).not_to eq(:success)
+
+ expect(GenericCommitStatus.last.description).to eq("Error: The uploaded artifact size does not match the expected value.")
+ project.pages_metadatum.reload
+ expect(project.pages_metadatum).not_to be_deployed
+ expect(project.pages_metadatum.pages_deployment).to be_ni
+ end.to raise_error(Projects::UpdatePagesService::WrongUploadedDeploymentSizeError)
+ end
+ end
end
end