mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
FIX: prevents group show serializer to override basic group serializer (#10326)
This commit is contained in:
@ -1,33 +0,0 @@
|
||||
moduleFor("controller:group", {
|
||||
needs: ["controller:application"]
|
||||
});
|
||||
|
||||
QUnit.test("canEditGroup", function(assert) {
|
||||
const GroupController = this.subject();
|
||||
|
||||
GroupController.setProperties({
|
||||
model: { is_group_owner: true, automatic: true }
|
||||
});
|
||||
|
||||
assert.equal(
|
||||
GroupController.get("canEditGroup"),
|
||||
false,
|
||||
"automatic groups cannot be edited"
|
||||
);
|
||||
|
||||
GroupController.set("model.automatic", false);
|
||||
|
||||
assert.equal(
|
||||
GroupController.get("canEditGroup"),
|
||||
true,
|
||||
"owners can edit groups"
|
||||
);
|
||||
|
||||
GroupController.set("model.is_group_owner", false);
|
||||
|
||||
assert.equal(
|
||||
GroupController.get("canEditGroup"),
|
||||
false,
|
||||
"normal users cannot edit groups"
|
||||
);
|
||||
});
|
Reference in New Issue
Block a user