diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2016-09-29 22:04:54 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2016-09-29 22:07:53 +0200 |
commit | bc3a4f348d8d73821a80a8033c48e7e1eb020e5c (patch) | |
tree | 592fad5f77bc8af2b5d6f3c2a34677e919feab7d /test/t2200-tuvotereminder.sh | |
parent | eb367d97e28d157036c1bf4f1ee65b0d17d756ea (diff) | |
download | aur-bc3a4f348d8d73821a80a8033c48e7e1eb020e5c.tar.gz aur-bc3a4f348d8d73821a80a8033c48e7e1eb020e5c.tar.xz |
t2200: Check that only non-voters get reminders
Add a test to make sure that Trusted Users, who already voted on a
proposal, do not receive any reminders.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'test/t2200-tuvotereminder.sh')
-rwxr-xr-x | test/t2200-tuvotereminder.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/t2200-tuvotereminder.sh b/test/t2200-tuvotereminder.sh index 8477c92b..c82ce874 100755 --- a/test/t2200-tuvotereminder.sh +++ b/test/t2200-tuvotereminder.sh @@ -22,4 +22,32 @@ test_expect_success 'Test Trusted User vote reminders.' ' test_must_fail grep -q "Proposal 4" sendmail.out ' +test_expect_success 'Check that only TUs who did not vote receive reminders.' ' + cat <<-EOD | sqlite3 aur.db && + INSERT INTO TU_Votes (VoteID, UserID) VALUES (1, 2); + INSERT INTO TU_Votes (VoteID, UserID) VALUES (2, 2); + INSERT INTO TU_Votes (VoteID, UserID) VALUES (3, 2); + INSERT INTO TU_Votes (VoteID, UserID) VALUES (4, 2); + INSERT INTO TU_Votes (VoteID, UserID) VALUES (1, 7); + INSERT INTO TU_Votes (VoteID, UserID) VALUES (3, 7); + INSERT INTO TU_Votes (VoteID, UserID) VALUES (2, 8); + INSERT INTO TU_Votes (VoteID, UserID) VALUES (4, 8); + INSERT INTO TU_Votes (VoteID, UserID) VALUES (1, 9); + EOD + >sendmail.out && + "$TUVOTEREMINDER" && + cat <<-EOD >expected && + Subject: TU Vote Reminder: Proposal 2 + To: tu2@localhost + Subject: TU Vote Reminder: Proposal 2 + To: tu4@localhost + Subject: TU Vote Reminder: Proposal 3 + To: tu3@localhost + Subject: TU Vote Reminder: Proposal 3 + To: tu4@localhost + EOD + grep "^\(Subject\|To\)" sendmail.out >sendmail.parts && + test_cmp sendmail.parts expected +' + test_done |