diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /spec/uploaders/content_type_whitelist_spec.rb | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/uploaders/content_type_whitelist_spec.rb')
-rw-r--r-- | spec/uploaders/content_type_whitelist_spec.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/spec/uploaders/content_type_whitelist_spec.rb b/spec/uploaders/content_type_whitelist_spec.rb index 4689f83759d..32d030cdfee 100644 --- a/spec/uploaders/content_type_whitelist_spec.rb +++ b/spec/uploaders/content_type_whitelist_spec.rb @@ -3,16 +3,20 @@ require 'spec_helper' describe ContentTypeWhitelist do - class DummyUploader < CarrierWave::Uploader::Base - include ContentTypeWhitelist::Concern + let_it_be(:model) { build_stubbed(:user) } + let!(:uploader) do + stub_const('DummyUploader', Class.new(CarrierWave::Uploader::Base)) + + DummyUploader.class_eval do + include ContentTypeWhitelist::Concern - def content_type_whitelist - %w[image/png image/jpeg] + def content_type_whitelist + %w[image/png image/jpeg] + end end - end - let_it_be(:model) { build_stubbed(:user) } - let_it_be(:uploader) { DummyUploader.new(model, :dummy) } + DummyUploader.new(model, :dummy) + end context 'upload whitelisted file content type' do let(:path) { File.join('spec', 'fixtures', 'rails_sample.jpg') } |