mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
DEV: Fix flaky UploadSecurity spec
This commit is contained in:
parent
f6c5fb21bd
commit
c664ba8fa8
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user