mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Instead of only checking whether the notification script is called with the correct parameters, actually invoke the real notify script and check whether proper notifications are generated. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
25 lines
1 KiB
Bash
Executable file
25 lines
1 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
test_description='tuvotereminder tests'
|
|
|
|
. ./setup.sh
|
|
|
|
test_expect_success 'Test Trusted User vote reminders.' '
|
|
now=$(date -d now +%s) &&
|
|
tomorrow=$(date -d tomorrow +%s) &&
|
|
threedays=$(date -d "3 days" +%s) &&
|
|
cat <<-EOD | sqlite3 aur.db &&
|
|
INSERT INTO TU_VoteInfo (ID, Agenda, User, Submitted, End, Quorum, SubmitterID) VALUES (1, "Lorem ipsum.", "user", 0, $now, 0.00, 2);
|
|
INSERT INTO TU_VoteInfo (ID, Agenda, User, Submitted, End, Quorum, SubmitterID) VALUES (2, "Lorem ipsum.", "user", 0, $tomorrow, 0.00, 2);
|
|
INSERT INTO TU_VoteInfo (ID, Agenda, User, Submitted, End, Quorum, SubmitterID) VALUES (3, "Lorem ipsum.", "user", 0, $tomorrow, 0.00, 2);
|
|
INSERT INTO TU_VoteInfo (ID, Agenda, User, Submitted, End, Quorum, SubmitterID) VALUES (4, "Lorem ipsum.", "user", 0, $threedays, 0.00, 2);
|
|
EOD
|
|
>sendmail.out &&
|
|
"$TUVOTEREMINDER" &&
|
|
grep -q "Proposal 2" sendmail.out &&
|
|
grep -q "Proposal 3" sendmail.out &&
|
|
test_must_fail grep -q "Proposal 1" sendmail.out &&
|
|
test_must_fail grep -q "Proposal 4" sendmail.out
|
|
'
|
|
|
|
test_done
|