# HG changeset patch # User Paul Boddie # Date 1441408823 -7200 # Node ID 59ccd88f800b7fb81617738906ba24e3f3c8e86f # Parent 6f5834b4e4d47b9c943eed4b680e4f6450839f6d Added a test of refreshing events involving cancelled recurrences. diff -r 6f5834b4e4d4 -r 59ccd88f800b tests/templates/event-cancel-person-recurring-rescheduled-instance.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/templates/event-cancel-person-recurring-rescheduled-instance.txt Sat Sep 05 01:20:23 2015 +0200 @@ -0,0 +1,37 @@ +Content-Type: multipart/alternative; boundary="===============0047278175==" +MIME-Version: 1.0 +From: paul.boddie@example.com +To: vincent.vole@example.com +Subject: Cancellation! + +Cancel an instance for vincent.vole and paul.boddie. + +--===============0047278175== +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit + +This message contains an event. +--===============0047278175== +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Content-Type: text/calendar; charset="us-ascii"; method="CANCEL" + +BEGIN:VCALENDAR +PRODID:-//imip-agent/test//EN +METHOD:CANCEL +VERSION:2.0 +BEGIN:VEVENT +ORGANIZER:mailto:paul.boddie@example.com +ATTENDEE;RSVP=TRUE:mailto:vincent.vole@example.com +ATTENDEE;RSVP=TRUE:mailto:paul.boddie@example.com +DTSTAMP:20141009T182400Z +DTSTART;TZID=Europe/Oslo:20141010T100000 +DTEND;TZID=Europe/Oslo:20141010T110000 +SUMMARY:Recurring event +UID:event8@example.com +RECURRENCE-ID;TZID=Europe/Oslo:20141010T100000 +END:VEVENT +END:VCALENDAR + +--===============0047278175==-- diff -r 6f5834b4e4d4 -r 59ccd88f800b tests/test_person_invitation_refresh.sh --- a/tests/test_person_invitation_refresh.sh Sat Sep 05 01:19:56 2015 +0200 +++ b/tests/test_person_invitation_refresh.sh Sat Sep 05 01:20:23 2015 +0200 @@ -98,3 +98,45 @@ ! grep -q 'METHOD:REQUEST' out5.tmp \ && echo "Success" \ || echo "Failed" + +# Test rescheduling in the outgoing handler. + +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-request-person-recurring-reschedule-instance.txt" 2>> $ERROR + + grep -q "^20141011T080000Z${TAB}20141011T090000Z" "$FBSENDERFILE" \ +&& ! grep -q "^20141010T080000Z${TAB}20141010T090000Z" "$FBSENDERFILE" \ +&& echo "Success" \ +|| echo "Failed" + +# Test another request from an attendee for the event details to be refreshed. + + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-refresh-person-recurring.txt" 2>> $ERROR \ +| "$SHOWMAIL" \ +> out6.tmp + + grep -q 'METHOD:REQUEST' out6.tmp \ +&& grep -q 'RECURRENCE-ID' out6.tmp \ +&& [ `grep 'BEGIN:VEVENT' out6.tmp | wc -l` = '2' ] \ +&& echo "Success" \ +|| echo "Failed" + +# Cancel a recurrence. + +"$OUTGOING_SCRIPT" $ARGS < "$TEMPLATES/event-cancel-person-recurring-rescheduled-instance.txt" 2>> $ERROR + + ! grep -q "^20141011T080000Z${TAB}20141011T090000Z" "$FBSENDERFILE" \ +&& echo "Success" \ +|| echo "Failed" + +# Test another request from an attendee for the event details to be refreshed. +# The additional recurrence should now be absent. + + "$PERSON_SCRIPT" $ARGS < "$TEMPLATES/event-refresh-person-recurring.txt" 2>> $ERROR \ +| "$SHOWMAIL" \ +> out7.tmp + + grep -q 'METHOD:REQUEST' out7.tmp \ +&& ! grep -q 'RECURRENCE-ID' out7.tmp \ +&& [ `grep 'BEGIN:VEVENT' out7.tmp | wc -l` = '1' ] \ +&& echo "Success" \ +|| echo "Failed"