diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /spec/models/pages/lookup_path_spec.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/models/pages/lookup_path_spec.rb')
-rw-r--r-- | spec/models/pages/lookup_path_spec.rb | 63 |
1 files changed, 2 insertions, 61 deletions
diff --git a/spec/models/pages/lookup_path_spec.rb b/spec/models/pages/lookup_path_spec.rb index f8ebc237577..30712af6b32 100644 --- a/spec/models/pages/lookup_path_spec.rb +++ b/spec/models/pages/lookup_path_spec.rb @@ -9,7 +9,6 @@ RSpec.describe Pages::LookupPath do before do stub_pages_setting(access_control: true, external_https: ["1.1.1.1:443"]) - stub_artifacts_object_storage stub_pages_object_storage(::Pages::DeploymentUploader) end @@ -66,7 +65,7 @@ RSpec.describe Pages::LookupPath do end it 'uses deployment from object storage' do - Timecop.freeze do + freeze_time do expect(source).to( eq({ type: 'zip', @@ -86,7 +85,7 @@ RSpec.describe Pages::LookupPath do end it 'uses file protocol' do - Timecop.freeze do + freeze_time do expect(source).to( eq({ type: 'zip', @@ -117,64 +116,6 @@ RSpec.describe Pages::LookupPath do include_examples 'uses disk storage' end end - - context 'when artifact_id from build job is present in pages metadata' do - let(:artifacts_archive) { create(:ci_job_artifact, :zip, :remote_store, project: project) } - - before do - project.mark_pages_as_deployed(artifacts_archive: artifacts_archive) - end - - it 'uses artifacts object storage' do - Timecop.freeze do - expect(source).to( - eq({ - type: 'zip', - path: artifacts_archive.file.url(expire_at: 1.day.from_now), - global_id: "gid://gitlab/Ci::JobArtifact/#{artifacts_archive.id}", - sha256: artifacts_archive.file_sha256, - file_size: artifacts_archive.size, - file_count: nil - }) - ) - end - end - - context 'when artifact is not uploaded to object storage' do - let(:artifacts_archive) { create(:ci_job_artifact, :zip) } - - it 'uses file protocol', :aggregate_failures do - Timecop.freeze do - expect(source).to( - eq({ - type: 'zip', - path: 'file://' + artifacts_archive.file.path, - global_id: "gid://gitlab/Ci::JobArtifact/#{artifacts_archive.id}", - sha256: artifacts_archive.file_sha256, - file_size: artifacts_archive.size, - file_count: nil - }) - ) - end - end - - context 'when pages_serve_with_zip_file_protocol feature flag is disabled' do - before do - stub_feature_flags(pages_serve_with_zip_file_protocol: false) - end - - include_examples 'uses disk storage' - end - end - - context 'when feature flag is disabled' do - before do - stub_feature_flags(pages_serve_from_artifacts_archive: false) - end - - include_examples 'uses disk storage' - end - end end describe '#prefix' do |