2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

FIX: Remove 'staff_only' results option for non-staff (#8565)

This commit is contained in:
Mark VanLandingham 2019-12-17 13:43:15 -08:00 committed by GitHub
parent e916bd7ea0
commit 44612f900e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 5 deletions

View file

@ -311,3 +311,25 @@ test("multiple pollOutput", function(assert) {
"it should return the right output"
);
});
test("staff_only option is not present for non-staff", function(assert) {
const controller = this.subject();
controller.currentUser = { staff: false };
assert.ok(
controller.pollResults.filter(result => result.value === "staff_only")
.length === 0,
"staff_only is not present"
);
});
test("staff_only option is present for staff", function(assert) {
const controller = this.subject();
controller.currentUser = { staff: true };
assert.ok(
controller.pollResults.filter(result => result.value === "staff_only")
.length === 1,
"staff_only is present"
);
});