Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-17 06:12:26 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-17 06:12:26 +0300
commit3a3496a81b10b1e8da1d628c3d9f4dea15f89df1 (patch)
tree488f6a7554b762451653f5383d691aa35e76b4e7 /spec/uploaders
parent1b1bd461da768b31adb730f42060b7d6adf548c5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/uploaders')
-rw-r--r--spec/uploaders/object_storage/cdn_spec.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/uploaders/object_storage/cdn_spec.rb b/spec/uploaders/object_storage/cdn_spec.rb
index a64e7000855..d6c638297fa 100644
--- a/spec/uploaders/object_storage/cdn_spec.rb
+++ b/spec/uploaders/object_storage/cdn_spec.rb
@@ -32,6 +32,7 @@ RSpec.describe ObjectStorage::CDN, feature_category: :build_artifacts do
let(:object) { build_stubbed(:user) }
let(:public_ip) { '18.245.0.1' }
+ let(:query_params) { { foo: :bar } }
let_it_be(:project) { build(:project) }
@@ -46,9 +47,9 @@ RSpec.describe ObjectStorage::CDN, feature_category: :build_artifacts do
describe '#cdn_enabled_url' do
it 'calls #cdn_signed_url' do
expect(subject).not_to receive(:url)
- expect(subject).to receive(:cdn_signed_url).and_call_original
+ expect(subject).to receive(:cdn_signed_url).with(query_params).and_call_original
- result = subject.cdn_enabled_url(public_ip)
+ result = subject.cdn_enabled_url(public_ip, query_params)
expect(result.used_cdn).to be true
end
@@ -76,6 +77,17 @@ RSpec.describe ObjectStorage::CDN, feature_category: :build_artifacts do
uploader_class.options = Gitlab.config.uploads
end
+ describe '#cdn_enabled_url' do
+ it 'calls #url' do
+ expect(subject).not_to receive(:cdn_signed_url)
+ expect(subject).to receive(:url).with(query: query_params).and_call_original
+
+ result = subject.cdn_enabled_url(public_ip, query_params)
+
+ expect(result.used_cdn).to be false
+ end
+ end
+
describe '#use_cdn?' do
it 'returns false' do
expect(subject.use_cdn?(public_ip)).to be false