DEV: Fix flaky UploadSecurity spec

This commit is contained in:
Penar Musaraj 2020-09-18 14:35:36 -04:00
parent f6c5fb21bd
commit c664ba8fa8
No known key found for this signature in database
GPG Key ID: E390435D881FF0F7
2 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,11 @@ class UploadSecurity
@@custom_public_types << type if !@@custom_public_types.include?(type)
end
# used in tests
def self.reset_custom_public_types
@@custom_public_types = []
end
def initialize(upload, opts = {})
@upload = upload
@opts = opts

View File

@ -74,6 +74,7 @@ RSpec.describe UploadSecurity do
it "returns false if the custom type has been added" do
UploadSecurity.register_custom_public_type(type)
expect(subject.should_be_secure?).to eq(false)
UploadSecurity.reset_custom_public_types
end
end
describe "for_theme" do