1.1 --- a/tests/test_resource_invitation_constraints_next_free.sh Wed Oct 28 11:56:06 2015 +0100
1.2 +++ b/tests/test_resource_invitation_constraints_next_free.sh Wed Oct 28 12:52:31 2015 +0100
1.3 @@ -213,3 +213,35 @@
1.4 && grep -q "^20141126T200000Z${TAB}20141126T204500Z" "$FBFILE" \
1.5 && echo "Success" \
1.6 || echo "Failed"
1.7 +
1.8 +# Test scheduling again with a different period. This should disregard the
1.9 +# existing event periods when computing availability in order to be able to
1.10 +# offer them again. Otherwise, an offer would be made for even later periods.
1.11 +
1.12 + sed 's/20141126T160000/20141126T161500/' < "$TEMPLATES/event-request-sauna-good.txt" \
1.13 +| tee out11.tmp \
1.14 +| "$RESOURCE_SCRIPT" $ARGS 2>> $ERROR \
1.15 +| "$SHOWMAIL" \
1.16 +> out12.tmp
1.17 +
1.18 + grep -q 'METHOD:COUNTER' out12.tmp \
1.19 +&& grep -q 'DTSTART;TZID=Europe/Oslo.*:20141126T210000' out12.tmp \
1.20 +&& echo "Success" \
1.21 +|| echo "Failed"
1.22 +
1.23 +# Note that the duration is different now.
1.24 +
1.25 + ! grep -q "^20141126T150000Z${TAB}20141126T154500Z" "$FBOFFERFILE" \
1.26 +&& ! grep -q "^20141126T160000Z${TAB}20141126T164500Z" "$FBOFFERFILE" \
1.27 +&& ! grep -q "^20141126T170000Z${TAB}20141126T174500Z" "$FBOFFERFILE" \
1.28 +&& ! grep -q "^20141126T180000Z${TAB}20141126T184500Z" "$FBOFFERFILE" \
1.29 +&& ! grep -q "^20141126T190000Z${TAB}20141126T194500Z" "$FBOFFERFILE" \
1.30 +&& grep -q "^20141126T200000Z${TAB}20141126T203000Z" "$FBOFFERFILE" \
1.31 +&& echo "Success" \
1.32 +|| echo "Failed"
1.33 +
1.34 + [ `grep "event19@example.com" "$FBFILE" | wc -l` = '5' ] \
1.35 +&& [ `grep "event13@example.com" "$FBFILE" | wc -l` = '1' ] \
1.36 +&& grep -q "^20141126T200000Z${TAB}20141126T204500Z" "$FBFILE" \
1.37 +&& echo "Success" \
1.38 +|| echo "Failed"