Reopen a closed vote until its results are shown; check mark in the center mark and on the phone; vote title during enrollment; projector opens in a window
This commit is contained in:
@@ -173,12 +173,22 @@ def test_full_flow_and_anonymity(server):
|
||||
r = await a.post(f"/api/v/{p['id']}/vote", json={"question_id": qid, "choices": [0]})
|
||||
assert r.status_code == 409 and r.json()["error"] == "not_open"
|
||||
|
||||
# closed too early: reopening keeps the ballots and the voted flags
|
||||
assert admin(server, p, "POST", f"/questions/{qid}/reopen").status_code == 200
|
||||
r = await a.post(f"/api/v/{p['id']}/vote", json={"question_id": qid, "choices": [1]})
|
||||
assert r.status_code == 409 and r.json()["error"] == "already_voted"
|
||||
assert admin(server, p, "POST", f"/questions/{qid}/close").status_code == 200
|
||||
|
||||
# voters only see results once published
|
||||
me = (await a.get(f"/api/v/{p['id']}/me")).json()
|
||||
assert me["questions"] == []
|
||||
admin(server, p, "POST", f"/questions/{qid}/publish")
|
||||
me = (await a.get(f"/api/v/{p['id']}/me")).json()
|
||||
assert me["questions"][0]["results"]["counts"] == [1, 0]
|
||||
# once the room has seen the tally there is no going back, even after hiding it
|
||||
admin(server, p, "POST", f"/questions/{qid}/unpublish")
|
||||
r = admin(server, p, "POST", f"/questions/{qid}/reopen")
|
||||
assert r.status_code == 400 and r.json()["error"] == "already_shown"
|
||||
await a.aclose()
|
||||
await b.aclose()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user