mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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>
This commit is contained in:
parent
eb367d97e2
commit
bc3a4f348d
2 changed files with 31 additions and 0 deletions
|
@ -115,6 +115,9 @@ echo "INSERT INTO Users (ID, UserName, Passwd, Email, AccountTypeID) VALUES (3,
|
|||
echo "INSERT INTO Users (ID, UserName, Passwd, Email, AccountTypeID) VALUES (4, 'user2', '!', 'user2@localhost', 1);" | sqlite3 aur.db
|
||||
echo "INSERT INTO Users (ID, UserName, Passwd, Email, AccountTypeID) VALUES (5, 'user3', '!', 'user3@localhost', 1);" | sqlite3 aur.db
|
||||
echo "INSERT INTO Users (ID, UserName, Passwd, Email, AccountTypeID) VALUES (6, 'user4', '!', 'user4@localhost', 1);" | sqlite3 aur.db
|
||||
echo "INSERT INTO Users (ID, UserName, Passwd, Email, AccountTypeID) VALUES (7, 'tu2', '!', 'tu2@localhost', 2);" | sqlite3 aur.db
|
||||
echo "INSERT INTO Users (ID, UserName, Passwd, Email, AccountTypeID) VALUES (8, 'tu3', '!', 'tu3@localhost', 2);" | sqlite3 aur.db
|
||||
echo "INSERT INTO Users (ID, UserName, Passwd, Email, AccountTypeID) VALUES (9, 'tu4', '!', 'tu4@localhost', 2);" | sqlite3 aur.db
|
||||
|
||||
echo "INSERT INTO SSHPubKeys (UserID, Fingerprint, PubKey) VALUES (1, '$AUTH_FINGERPRINT_USER', '$AUTH_KEYTYPE_USER $AUTH_KEYTEXT_USER');" | sqlite3 aur.db
|
||||
echo "INSERT INTO SSHPubKeys (UserID, Fingerprint, PubKey) VALUES (2, '$AUTH_FINGERPRINT_TU', '$AUTH_KEYTYPE_TU $AUTH_KEYTEXT_TU');" | sqlite3 aur.db
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue