summaryrefslogtreecommitdiff
path: root/gnus-icalendar-request-tests.el
diff options
context:
space:
mode:
authorfpi2024-09-22 16:53:34 +0200
committerfpi2024-09-22 16:53:34 +0200
commita961b9efb6a8178cd537608157904e703ab457d7 (patch)
tree391e8eb5216e3191af03c1be9e4d762b3deb6df0 /gnus-icalendar-request-tests.el
parentDocument problems with current ical-event class (diff)
Mostly adhere to gnus-ical-event-request data typesHEADmaster
participants entries should be a list of stringes. Currently I parse them all participants in one string and separate it later
Diffstat (limited to 'gnus-icalendar-request-tests.el')
-rw-r--r--gnus-icalendar-request-tests.el42
1 files changed, 16 insertions, 26 deletions
diff --git a/gnus-icalendar-request-tests.el b/gnus-icalendar-request-tests.el
index b9a2954..73a001d 100644
--- a/gnus-icalendar-request-tests.el
+++ b/gnus-icalendar-request-tests.el
@@ -62,31 +62,21 @@ END:VEVENT"))
(ert-deftest gnus-icalendar--ical-from-event ()
""
- (let* ((event-string "\
-BEGIN:VEVENT
-DTSTAMP:20240915T120000Z
-DTSTART:20240917T080000Z
-DTEND:20240917T100000Z
-SUMMARY:Party
-DESCRIPTION:Lots of reasons to celebrate!
-ATTENDEE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE;CN=Required CN:mailto:required@company.invalid
-ATTENDEE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:mailto:required2@company.invalid
-ATTENDEE;PARTSTAT=NEEDS-ACTION;ROLE=OPT-PARTICIPANT;RSVP=TRUE:mailto:optional@company.invalid
-LOCATION:Party room
-ORGANIZER:mailto:organizer@company.invalid
-UID:ac44f43e-f5cd-4b0a-878e-add01aeb12dd
-SEQUENCE:0
-END:VEVENT")
- (vcalendar-string (format "\
-BEGIN:VCALENDAR
-PRODID:-//Google Inc//Google Calendar 70.9054//EN
-VERSION:2.0
-CALSCALE:GREGORIAN
-METHOD:REQUEST
-%s
-END:VCALENDAR"
- event-string))
- (event (gnus-icalendar-tests--get-ical-event vcalendar-string))
+ (let* ((event
+ (gnus-icalendar-event-request
+ :uid "ac44f43e-f5cd-4b0a-878e-add01aeb12dd"
+ :recur nil
+ :location "Party room"
+ :description "Lots of reasons to celebrate!"
+ :summary "Party"
+ :method "REQUEST"
+ :organizer "organizer@company.invalid"
+ :start-time (encode-time '(0 0 8 17 9 2024 nil -1 t))
+ :end-time (encode-time '(0 0 10 17 9 2024 nil -1 t))
+ :rsvp nil
+ :participation-type 'non-participant
+ :req-participants '("Required CN <required@company.invalid>" "required2@company.invalid")
+ :opt-participants '("optional@company.invalid")))
(ical (gnus-icalendar--ical-from-event event)))
(should (string-match "^BEGIN:VEVENT$" ical))
(should (string-match "^END:VEVENT$" ical))
@@ -95,7 +85,7 @@ END:VCALENDAR"
(should (string-match "^DTEND:20240917T100000Z$" ical))
(should (string-match "^SUMMARY:Party$" ical))
(should (string-match "^DESCRIPTION:Lots of reasons to celebrate!$" ical))
- (should (string-match "^ATTENDEE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:mailto:required@company.invalid$" ical))
+ (should (string-match "^ATTENDEE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE;CN=Required CN:mailto:required@company.invalid$" ical))
(should (string-match "^ATTENDEE;PARTSTAT=NEEDS-ACTION;ROLE=OPT-PARTICIPANT;RSVP=TRUE:mailto:optional@company.invalid$" ical))
(should (string-match "^LOCATION:Party room$" ical))
(should (string-match "^ORGANIZER:mailto:organizer@company.invalid$" ical))