Merge branch 'master' of github.com:DAViCal/davical into github
[davical.git] / testing / tests / regression-suite / 0887-POST-freebusy.test
blob5f8c5a6e16f0218f7097a982472475586bf522c6
2 # POST to scheduling outbox for freebusy query on user1
3 # matching query on 0885 and 0886
5 TYPE=POST
7 URL=http://regression.host/caldav.php/user1/.out/
9 HEADER=User-Agent: DAViCal Regression Testing
10 HEADER=Accept: text/xml
11 HEADER=Content-Type: text/calendar; charset=utf-8
13 REPLACE=/^DTSTAMP:\d{4}[01]\d[0123]\dT[012]\d[0-5]\d[0-6]\dZ\r?$/DTSTAMP:yyyymmddThhmmssZ/
14 REPLACE=/^DTSTART:20060930T120000Z\r?$/DTSTART:correct/
15 REPLACE=/^DTEND:20070630T115959Z\r?$/DTEND:correct/
17 BEGINDATA
18 BEGIN:VCALENDAR
19 PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
20 VERSION:2.0
21 METHOD:REQUEST
22 BEGIN:VFREEBUSY
23 DTSTAMP:20081022T062945Z
24 ORGANIZER:mailto:user1@example.net
25 DTSTART:20060930T120000Z
26 DTEND:20070630T115959Z
27 UID:c5bd82ea-cd89-4f58-8d31-336f47e44f97
28 ATTENDEE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;CUTYPE=INDIVIDUAL:
29  mailto:user1@example.net
30 END:VFREEBUSY
31 END:VCALENDAR
32 ENDDATA
34 QUERY
35 SELECT dav_name AS "Dav Name", calendar_item.rrule, status,
36      to_char(calendar_item.dtstart at time zone 'GMT','YYYYMMDD"T"HH24MISS"Z"') AS "a) start",
37      to_char(calendar_item.dtend at time zone 'GMT','YYYYMMDD"T"HH24MISS"Z"') AS "b)finish"
38   FROM caldav_data INNER JOIN calendar_item USING(dav_id,user_no,dav_name)
39  WHERE caldav_data.user_no = 10
40    AND rrule_event_overlaps( dtstart, dtend, rrule, '20061001T000000', '20070630T235959')
41    AND caldav_data.caldav_type IN ( 'VEVENT', 'VFREEBUSY' )
42    AND (calendar_item.status != 'CANCELLED' OR calendar_item.status IS NULL)
43    AND (calendar_item.class != 'PRIVATE' OR calendar_item.class IS NULL)
44  ORDER BY 2, 3, 4
45 ENDQUERY