diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
commit | 85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch) | |
tree | 9160f299afd8c80c038f08e1545be119f5e3f1e1 /spec/initializers | |
parent | 15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff) | |
download | gitlab-ce-85dc423f7090da0a52c73eb66faf22ddb20efff9.tar.gz |
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'spec/initializers')
-rw-r--r-- | spec/initializers/carrierwave_patch_spec.rb | 12 | ||||
-rw-r--r-- | spec/initializers/remove_active_job_execute_callback_spec.rb | 9 |
2 files changed, 21 insertions, 0 deletions
diff --git a/spec/initializers/carrierwave_patch_spec.rb b/spec/initializers/carrierwave_patch_spec.rb index d577eca2ac7..c4a7bfa59c6 100644 --- a/spec/initializers/carrierwave_patch_spec.rb +++ b/spec/initializers/carrierwave_patch_spec.rb @@ -28,5 +28,17 @@ RSpec.describe 'CarrierWave::Storage::Fog::File' do expect(subject.authenticated_url).to eq("https://sa.blob.core.windows.net/test_container/test_blob?token") end end + + context 'with custom expire_at' do + it 'properly sets expires param' do + expire_at = 24.hours.from_now + + expect_next_instance_of(Fog::Storage::AzureRM::File) do |file| + expect(file).to receive(:url).with(expire_at).and_call_original + end + + expect(subject.authenticated_url(expire_at: expire_at)).to eq("https://sa.blob.core.windows.net/test_container/test_blob?token") + end + end end end diff --git a/spec/initializers/remove_active_job_execute_callback_spec.rb b/spec/initializers/remove_active_job_execute_callback_spec.rb new file mode 100644 index 00000000000..e88b859aa77 --- /dev/null +++ b/spec/initializers/remove_active_job_execute_callback_spec.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'ActiveJob execute callback' do + it 'is removed in test environment' do + expect(ActiveJob::Callbacks.singleton_class.__callbacks[:execute].send(:chain).size).to eq(0) + end +end |