FEATURE: Allow group owners to edit group name and avatar flair.

This commit is contained in:
Guo Xiang Tan
2016-11-29 16:25:02 +08:00
parent b45fd21ed9
commit 31acd311e5
26 changed files with 453 additions and 209 deletions
@@ -32,7 +32,7 @@ test("Browsing Groups", () => {
});
});
test("Messages tab", () => {
test("Admin Browsing Groups", () => {
logIn();
Discourse.reset();
@@ -41,4 +41,10 @@ test("Messages tab", () => {
andThen(() => {
ok($('.action-list li').length === 5, 'it should show messages tab if user is admin');
});
click('.group-edit-btn');
andThen(() => {
ok(find('.group-flair-inputs').length === 1, 'it should display avatar flair inputs');
});
});
@@ -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");
});
@@ -7,7 +7,8 @@ export default {
"user_count":8,
"alias_level":0,
"visible":true,
"flair_url": 'fa-adjust'
"flair_url": 'fa-adjust',
"is_group_owner":true
}
},
"/groups/discourse/counts.json":{