2017-06-14 13:57:58 -04:00
|
|
|
moduleFor("controller:admin-group", {
|
|
|
|
needs: ['controller:adminGroupsType']
|
|
|
|
});
|
2016-12-12 09:46:45 -05:00
|
|
|
|
2017-06-14 13:57:58 -04:00
|
|
|
QUnit.test("disablePublicSetting", function(assert) {
|
2016-12-12 09:46:45 -05:00
|
|
|
this.subject().setProperties({
|
2017-07-04 10:01:36 -04:00
|
|
|
model: { visibility_level: 1, allow_membership_requests: false }
|
2016-12-12 09:46:45 -05:00
|
|
|
});
|
|
|
|
|
2017-06-14 13:57:58 -04:00
|
|
|
assert.equal(this.subject().get("disablePublicSetting"), true, "it should disable setting");
|
2016-12-12 09:46:45 -05:00
|
|
|
|
2017-07-04 10:01:36 -04:00
|
|
|
this.subject().set("model.visibility_level", 0);
|
2016-12-12 09:46:45 -05:00
|
|
|
|
2017-06-14 13:57:58 -04:00
|
|
|
assert.equal(this.subject().get("disablePublicSetting"), false, "it should enable setting");
|
2016-12-12 09:46:45 -05:00
|
|
|
|
|
|
|
this.subject().set("model.allow_membership_requests", true);
|
|
|
|
|
2017-06-14 13:57:58 -04:00
|
|
|
assert.equal(this.subject().get("disablePublicSetting"), true, "it should disable setting");
|
2016-12-12 09:46:45 -05:00
|
|
|
});
|
|
|
|
|
2017-06-14 13:57:58 -04:00
|
|
|
QUnit.test("disableMembershipRequestSetting", function(assert) {
|
2016-12-12 09:46:45 -05:00
|
|
|
this.subject().setProperties({
|
2017-07-27 22:37:10 -04:00
|
|
|
model: { visibility_level: 1, public_admission: false, canEveryoneMention: true }
|
2016-12-12 09:46:45 -05:00
|
|
|
});
|
|
|
|
|
2017-06-14 13:57:58 -04:00
|
|
|
assert.equal(this.subject().get("disableMembershipRequestSetting"), true, "it should disable setting");
|
2016-12-12 09:46:45 -05:00
|
|
|
|
2017-07-04 10:01:36 -04:00
|
|
|
this.subject().set("model.visibility_level", 0);
|
2016-12-12 09:46:45 -05:00
|
|
|
|
2017-07-27 22:37:10 -04:00
|
|
|
assert.equal(
|
|
|
|
this.subject().get("disableMembershipRequestSetting"), false,
|
|
|
|
"it should enable setting"
|
|
|
|
);
|
2016-12-12 09:46:45 -05:00
|
|
|
|
2017-07-27 22:37:10 -04:00
|
|
|
this.subject().set("model.public_admission", true);
|
2016-12-12 09:46:45 -05:00
|
|
|
|
2017-07-27 22:37:10 -04:00
|
|
|
assert.equal(
|
|
|
|
this.subject().get("disableMembershipRequestSetting"), true,
|
|
|
|
"it should disable setting"
|
|
|
|
);
|
2016-12-12 09:46:45 -05:00
|
|
|
});
|