mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Public groups.
This commit is contained in:
@@ -50,5 +50,6 @@ test("Admin Browsing Groups", () => {
|
||||
ok(find('.group-flair-inputs').length === 1, 'it should display avatar flair inputs');
|
||||
ok(find('.edit-group-bio').length === 1, 'it should display group bio input');
|
||||
ok(find('.edit-group-title').length === 1, 'it should display group title input');
|
||||
ok(find('.edit-group-public').length === 1, 'it should display group public input');
|
||||
});
|
||||
});
|
||||
|
||||
21
test/javascripts/controllers/group-index-test.js.es6
Normal file
21
test/javascripts/controllers/group-index-test.js.es6
Normal file
@@ -0,0 +1,21 @@
|
||||
import { currentUser } from "helpers/qunit-helpers";
|
||||
|
||||
moduleFor("controller:group-index");
|
||||
|
||||
test("canJoinGroup", function() {
|
||||
this.subject().setProperties({
|
||||
model: { public: false }
|
||||
});
|
||||
|
||||
this.subject().set("currentUser", currentUser());
|
||||
|
||||
equal(this.subject().get("canJoinGroup"), false, "non public group cannot be joined");
|
||||
|
||||
this.subject().set("model.public", true);
|
||||
|
||||
equal(this.subject().get("canJoinGroup"), true, "public group can be joined");
|
||||
|
||||
this.subject().setProperties({ currentUser: null, model: { public: true } });
|
||||
|
||||
equal(this.subject().get("canJoinGroup"), false, "can't join group when not logged in");
|
||||
});
|
||||
Reference in New Issue
Block a user