-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deserialize handles multiple events in ics (#36)
- Loading branch information
Showing
8 changed files
with
183 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
defmodule ICalendar.Mixfile do | ||
use Mix.Project | ||
|
||
@version "0.8.1" | ||
@version "1.0.0" | ||
|
||
def project do | ||
[ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,4 +44,76 @@ defmodule ICalendar.Util.DeserializeTest do | |
description: nil | ||
} | ||
end | ||
|
||
test "Handles date strings" do | ||
event = | ||
""" | ||
BEGIN:VEVENT | ||
DTSTART;VALUE=DATE:20190624 | ||
DTEND;VALUE=DATE:20190625 | ||
END:VEVENT | ||
""" | ||
|> String.trim() | ||
|> String.split("\n") | ||
|> Deserialize.build_event() | ||
|
||
assert %Event{} = event | ||
end | ||
|
||
test "Handle empty keys" do | ||
event = | ||
""" | ||
BEGIN:VEVENT | ||
DESCRIPTION: | ||
END:VEVENT | ||
""" | ||
|> String.trim() | ||
|> String.split("\n") | ||
|> Deserialize.build_event() | ||
|
||
assert %Event{} = event | ||
end | ||
|
||
test "Include ORGANIZER and ATTENDEEs in event" do | ||
event = | ||
""" | ||
BEGIN:VEVENT | ||
DTSTART:20190711T130000Z | ||
DTEND:20190711T150000Z | ||
DTSTAMP:20190719T195201Z | ||
ORGANIZER;[email protected]:mailto:[email protected] | ||
UID:7E212264-C604-4071-892B-E0A28048F1BA | ||
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;[email protected];X-NUM-GUESTS=0:mailto:[email protected] | ||
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;[email protected];X-NUM-GUESTS=0:mailto:[email protected] | ||
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=James SM;X-NUM-GUESTS=0:mailto:[email protected] | ||
CREATED:20190709T192336Z | ||
DESCRIPTION: | ||
LAST-MODIFIED:20190711T130843Z | ||
LOCATION:In-person at Volta and https://zoom.us/j/12345678 | ||
SEQUENCE:0 | ||
STATUS:CONFIRMED | ||
SUMMARY:Design session | ||
END:VEVENT | ||
""" | ||
|> String.trim() | ||
|> String.split("\n") | ||
|> Deserialize.build_event() | ||
|
||
assert %Event{} = event | ||
end | ||
|
||
test "Convert other time zone formats to UTC" do | ||
event = | ||
""" | ||
BEGIN:VEVENT | ||
DTSTART;TZID=Greenwich Standard Time:20190726T190000 | ||
DTEND;TZID=Greenwich Standard Time:20190726T213000 | ||
END:VEVENT | ||
""" | ||
|> String.trim() | ||
|> String.split("\n") | ||
|> Deserialize.build_event() | ||
|
||
assert %Event{} = event | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters