mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 08:24:18 +08:00
staff can always upload a file
This commit is contained in:
@ -24,7 +24,6 @@ test("uploading one file", function() {
|
||||
|
||||
test("new user cannot upload images", function() {
|
||||
Discourse.SiteSettings.newuser_max_images = 0;
|
||||
this.stub(Discourse.User, 'currentProp').withArgs("trust_level").returns(0);
|
||||
this.stub(bootbox, "alert");
|
||||
|
||||
ok(!validUpload([{name: "image.png"}]));
|
||||
@ -33,7 +32,6 @@ test("new user cannot upload images", function() {
|
||||
|
||||
test("new user cannot upload attachments", function() {
|
||||
Discourse.SiteSettings.newuser_max_attachments = 0;
|
||||
this.stub(Discourse.User, 'currentProp').withArgs("trust_level").returns(0);
|
||||
this.stub(bootbox, "alert");
|
||||
|
||||
ok(!validUpload([{name: "roman.txt"}]));
|
||||
@ -52,6 +50,7 @@ test("ensures an authorized upload", function() {
|
||||
test("prevents files that are too big from being uploaded", function() {
|
||||
var image = { name: "image.png", size: 10 * 1024 };
|
||||
Discourse.SiteSettings.max_image_size_kb = 5;
|
||||
Discourse.User.currentProp("trust_level", 1);
|
||||
this.stub(bootbox, "alert");
|
||||
|
||||
ok(!validUpload([image]));
|
||||
@ -70,6 +69,7 @@ var dummyBlob = function() {
|
||||
};
|
||||
|
||||
test("allows valid uploads to go through", function() {
|
||||
Discourse.User.currentProp("trust_level", 1);
|
||||
Discourse.SiteSettings.max_image_size_kb = 15;
|
||||
this.stub(bootbox, "alert");
|
||||
|
||||
|
Reference in New Issue
Block a user