mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 22:53:43 +08:00
22 lines
641 B
Plaintext
22 lines
641 B
Plaintext
|
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");
|
||
|
});
|