require 'helper' class TestEvent < Test::Unit::TestCase should 'be able to parse event data from xml' do raw_xml = < 12/26/2011 12:00:00 AM Christmas Break END xml_node = Nokogiri::XML(raw_xml).root event = LotusNotesCalendar::Event.from_xml(LotusNotesCalendar::Calendar.new(''), xml_node) assert_equal '852571A7002389488525791200665961', event.id assert_equal Date.new(2011, 12, 26), event.at assert_equal 'Christmas Break', event.text end should 'be able to parse event data from html' do raw_html = < Calendar Event
Close


Mooresville Consolidated School Corporation
Calendar Event

Date12/27/2011

DescriptionChristmas Break
Details
END html_doc = Nokogiri::HTML(raw_html) event = LotusNotesCalendar::Event.from_html(LotusNotesCalendar::Calendar.new(''), '5C810F13E09AB8C785257912006662BC', html_doc) assert_equal '5C810F13E09AB8C785257912006662BC', event.id assert_equal Date.new(2011, 12, 27), event.at assert_equal 'Christmas Break', event.text end end