mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:21:12 +08:00
FIX: properly detect when attachments are allowed
This commit is contained in:
@ -164,13 +164,13 @@ test("avatarImg", function() {
|
||||
});
|
||||
|
||||
test("allowsAttachments", function() {
|
||||
Discourse.SiteSettings.authorized_extensions = "jpg|jpeg|gif";
|
||||
Discourse.SiteSettings.authorized_extensions = ".jpg, .jpeg, .gif";
|
||||
not(allowsAttachments(), "no attachments allowed by default");
|
||||
|
||||
Discourse.SiteSettings.authorized_extensions = "jpg|jpeg|gif|*";
|
||||
Discourse.SiteSettings.authorized_extensions = ".jpg, .jpeg, .gif, *";
|
||||
ok(allowsAttachments(), "attachments are allowed when all extensions are allowed");
|
||||
|
||||
Discourse.SiteSettings.authorized_extensions = "jpg|jpeg|gif|pdf";
|
||||
Discourse.SiteSettings.authorized_extensions = ".jpg, .jpeg, .gif, .pdf";
|
||||
ok(allowsAttachments(), "attachments are allowed when at least one extension is not an image extension");
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user