mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
enhance upload selector
- Change the icon on the button to a file when attachments are enabled - Display the list of allowed extensions in the upload selector - FIX : regexps for validating uploads weren't escaping the dots
This commit is contained in:
@ -92,9 +92,9 @@ describe SiteSetting do
|
||||
|
||||
describe "authorized_uploads" do
|
||||
|
||||
it "trims space and adds leading dots" do
|
||||
SiteSetting.stubs(:authorized_extensions).returns(" png | .jpeg|txt|bmp")
|
||||
SiteSetting.authorized_uploads.should == [".png", ".jpeg", ".txt", ".bmp"]
|
||||
it "trims spaces and leading dots" do
|
||||
SiteSetting.stubs(:authorized_extensions).returns(" png | .jpeg|txt|bmp | .tar.gz")
|
||||
SiteSetting.authorized_uploads.should == ["png", "jpeg", "txt", "bmp", "tar.gz"]
|
||||
end
|
||||
|
||||
end
|
||||
@ -103,7 +103,7 @@ describe SiteSetting do
|
||||
|
||||
it "filters non-image out" do
|
||||
SiteSetting.stubs(:authorized_extensions).returns(" png | .jpeg|txt|bmp")
|
||||
SiteSetting.authorized_images.should == [".png", ".jpeg", ".bmp"]
|
||||
SiteSetting.authorized_images.should == ["png", "jpeg", "bmp"]
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user