discourse/test/javascripts/controllers/admin-group-test.js.es6

36 lines
1.2 KiB
Plaintext
Raw Normal View History

2017-06-15 01:57:58 +08:00
moduleFor("controller:admin-group", {
needs: ['controller:adminGroupsType']
});
2017-06-15 01:57:58 +08:00
QUnit.test("disablePublicSetting", function(assert) {
this.subject().setProperties({
2017-07-04 22:01:36 +08:00
model: { visibility_level: 1, allow_membership_requests: false }
});
2017-06-15 01:57:58 +08:00
assert.equal(this.subject().get("disablePublicSetting"), true, "it should disable setting");
2017-07-04 22:01:36 +08:00
this.subject().set("model.visibility_level", 0);
2017-06-15 01:57:58 +08:00
assert.equal(this.subject().get("disablePublicSetting"), false, "it should enable setting");
this.subject().set("model.allow_membership_requests", true);
2017-06-15 01:57:58 +08:00
assert.equal(this.subject().get("disablePublicSetting"), true, "it should disable setting");
});
2017-06-15 01:57:58 +08:00
QUnit.test("disableMembershipRequestSetting", function(assert) {
this.subject().setProperties({
2017-07-04 22:01:36 +08:00
model: { visibility_level: 1, public: false, canEveryoneMention: true }
});
2017-06-15 01:57:58 +08:00
assert.equal(this.subject().get("disableMembershipRequestSetting"), true, "it should disable setting");
2017-07-04 22:01:36 +08:00
this.subject().set("model.visibility_level", 0);
2017-06-15 01:57:58 +08:00
assert.equal(this.subject().get("disableMembershipRequestSetting"), false, "it should enable setting");
this.subject().set("model.public", true);
2017-06-15 01:57:58 +08:00
assert.equal(this.subject().get("disableMembershipRequestSetting"), true, "it should disalbe setting");
});