mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:01:18 +08:00
FEATURE: Allow group owners to edit group name and avatar flair.
This commit is contained in:
19
test/javascripts/controllers/group-test.js.es6
Normal file
19
test/javascripts/controllers/group-test.js.es6
Normal file
@ -0,0 +1,19 @@
|
||||
moduleFor("controller:group");
|
||||
|
||||
test("canEditGroup", function() {
|
||||
const GroupController = this.subject();
|
||||
|
||||
GroupController.setProperties({
|
||||
model: { is_group_owner: true, automatic: true }
|
||||
});
|
||||
|
||||
equal(GroupController.get("canEditGroup"), false, "automatic groups cannot be edited");
|
||||
|
||||
GroupController.set("model.automatic", false);
|
||||
|
||||
equal(GroupController.get("canEditGroup"), true, "owners can edit groups");
|
||||
|
||||
GroupController.set("model.is_group_owner", false);
|
||||
|
||||
equal(GroupController.get("canEditGroup"), false, "normal users cannot edit groups");
|
||||
});
|
Reference in New Issue
Block a user