summaryrefslogtreecommitdiff
path: root/spec/support/shared_contexts
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-16 03:09:14 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-16 03:09:14 +0000
commit78fe72d153260c355fdfd533b125026cce310da7 (patch)
tree0d90106443bea87cc24e2834273ae6c8dcac0260 /spec/support/shared_contexts
parent88797b994a7dfd9bfab2a5d5431f088f17078b9f (diff)
downloadgitlab-ce-78fe72d153260c355fdfd533b125026cce310da7.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_contexts')
-rw-r--r--spec/support/shared_contexts/upload_type_check_shared_context.rb31
1 files changed, 0 insertions, 31 deletions
diff --git a/spec/support/shared_contexts/upload_type_check_shared_context.rb b/spec/support/shared_contexts/upload_type_check_shared_context.rb
index b0b569fe83f..f168cad961c 100644
--- a/spec/support/shared_contexts/upload_type_check_shared_context.rb
+++ b/spec/support/shared_contexts/upload_type_check_shared_context.rb
@@ -2,37 +2,6 @@
# Construct an `uploader` variable that is configured to `check_upload_type`
# with `mime_types` and `extensions`.
-RSpec.shared_context 'uploader with type check' do
- let(:uploader_class) do
- Class.new(GitlabUploader) do
- include UploadTypeCheck::Concern
- storage :file
- end
- end
-
- let(:mime_types) { nil }
- let(:extensions) { nil }
- let(:uploader) do
- uploader_class.class_exec(mime_types, extensions) do |mime_types, extensions|
- check_upload_type mime_types: mime_types, extensions: extensions
- end
- uploader_class.new(build_stubbed(:user))
- end
-end
-
-# This works with the UploadTypeCheck::Concern
-RSpec.shared_context 'stubbed MimeMagic mime type detection' do
- let(:mime_type) { '' }
- let(:magic_mime) { mime_type }
- let(:ext_mime) { mime_type }
- before do
- magic_mime_obj = MimeMagic.new(magic_mime)
- ext_mime_obj = MimeMagic.new(ext_mime)
- allow(MimeMagic).to receive(:by_magic).with(anything).and_return(magic_mime_obj)
- allow(MimeMagic).to receive(:by_path).with(anything).and_return(ext_mime_obj)
- end
-end
-
# @param uploader [CarrierWave::Uploader::Base] uploader with extension_whitelist method.
RSpec.shared_context 'ignore extension whitelist check' do
before do