spec/reg_spec.rb in Active-0.0.27 vs spec/reg_spec.rb in Active-0.0.28
- old
+ new
@@ -129,7 +129,38 @@
it "should have a start_time DateTime" do
a = RegCenter.find_by_id(@valid_id)
a.start_time.should be_an_instance_of(DateTime)
end
+ it "should have a valid eventURL" do
+ r = RegCenter.new(Hash.from_xml("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<event>\n <assetID>7e39ceb4-cebb-471f-ace3-21f697ae9e55</assetID>\n <eventID>1802851</eventID>\n <eventName>Rock 'n' Roll San Jose Half Marathon</eventName>\n <eventDate>2010-10-03T08:00:00-07:00</eventDate>\n <eventTime>08:00 am</eventTime>\n <eventLocation>Downtown</eventLocation>\n <eventAddress>Almaden Blvd & Santa Clara Street</eventAddress>\n <eventCity>San Jose</eventCity>\n <eventState>California</eventState>\n <eventZip>95192</eventZip>\n <eventCountry>USA</eventCountry>\n <briefDescription>Registration Fees:* \t \n<p> \n1/2 Marathon \n<p> \n * $85.00 \342\200\223 October 2009- July 31, 2010<br> \n * $100.00 \342\200\223 August 1, 2010- September 26<br> \n * $120.00 \342\200\223 Expo Price<br> \n<p> \n*Registration fees are non-refundable and non-transferable. Fees listed above do not include the Active Network processing fee. NO RACE DAY REGISTRATION</briefDescription>\n <usatSanctioned>false</usatSanctioned>\n <regOnline>false</regOnline>\n <currencyCode>USD</currencyCode>\n <eventTypeID>7</eventTypeID>\n <eventType>Event, Race</eventType>\n <hasEventResults>false</hasEventResults>\n <hasMetaResults>true</hasMetaResults>\n <showMap>true</showMap>\n <longitude>-121.8818</longitude>\n <latitude>37.3359</latitude>\n <eventContactEmail>rnrsj@eliteracing.com</eventContactEmail>\n <eventContactPhone>800-311-1255</eventContactPhone>\n <displayCloseDate>true</displayCloseDate>\n <excludedFromEmailing>false</excludedFromEmailing>\n <metaEventName>Rock 'n' Roll Half Marathon</metaEventName>\n <metaEventID>98616</metaEventID>\n <category>Activities</category>\n <mediaTypes>\n <mediaType>Event</mediaType>\n <mediaType>Event\\Half Marathon</mediaType>\n <mediaType>=difficulty:Advanced</mediaType>\n <mediaType>=difficulty:Beginner</mediaType>\n <mediaType>=difficulty:Intermediate</mediaType>\n </mediaTypes>\n <metaEvents>\n <event>\n <assetID>a401eaf3-6087-4dd2-822c-635a7ae45e74</assetID>\n <eventID>1614834</eventID>\n <eventName>Rock 'n' Roll Half Marathon - San Jose</eventName>\n <eventDate>2009-10-04T08:00:00-07:00</eventDate>\n <eventDetailsPageUrl>http://www.active.com/page/Event_Details.htm?event_id=1614834</eventDetailsPageUrl>\n </event>\n </metaEvents>\n <channels>\n <channel>\n <channelName>Running</channelName>\n <primaryChannel>true</primaryChannel>\n </channel>\n </channels>\n <eventCategories/>\n <eventDetails>\n <eventDetail>\n <eventDetailsName>Online Registration Closes</eventDetailsName>\n <eventDetailsOrder>1</eventDetailsOrder>\n <eventDetailsValue>Sunday, September 26, 2010</eventDetailsValue>\n </eventDetail>\n </eventDetails>\n <eventDonationLinks/>\n <eventSanctions/>\n <eventUrl>http://san-jose.competitor.com</eventUrl>\n <resultsUrl>http://results.active.com/pages/page.jsp?pubID=3&eventID=1802851</resultsUrl>\n <eventDetailsPageUrl>http://www.active.com/page/Event_Details.htm?event_id=1802851</eventDetailsPageUrl>\n <eventContactUrl>http://www.active.com/event_contact.cfm?event_id=1802851</eventContactUrl>\n <eventImageUrl>http://www.active.com/images/upimages/1802851.jpg</eventImageUrl>\n</event>\n"))
+ r.event_url.should eql("http://san-jose.competitor.com")
+ end
+
+ it "should have a valid content" do
+ r = RegCenter.new(Hash.from_xml('<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <event> <assetID>5c6fa2f2-0434-4d6c-953d-cab9bade4f64</assetID> <eventID>1877942</eventID> <eventName>Realistic Drawing (6-12 Yrs.)</eventName> <eventDate>2010-09-16T15:30:00-07:00</eventDate> <eventTime>3:30 PM</eventTime> <eventLocation>Arts & Crafts Room - Nick Rodriguez Community Center</eventLocation> <eventAddress>213 "F" Street</eventAddress> <eventCity>Antioch</eventCity> <eventState>California</eventState> <eventZip>94509</eventZip> <eventCountry>USA</eventCountry> <eventDescription>Do you love to draw?Learn how to make your drawings more realistic with projects that focus on observation,proportion,perspective,composition,light and shadow and texture.Media will include pencil,pen,charcoal,and pastel.A &10 materials fee is payable to the instuctor at the first class.</eventDescription> <usatSanctioned>false</usatSanctioned> <regOnline>true</regOnline> <eventCloseDate>2010-09-16T00:00:00-07:00</eventCloseDate> <currencyCode>USD</currencyCode> <eventTypeID>1</eventTypeID> <eventType>Recware Activities</eventType> <hasEventResults>false</hasEventResults> <hasMetaResults>false</hasMetaResults> <showMap>true</showMap> <longitude>-121.8058</longitude> <latitude>38.00492</latitude> <eventContactEmail>dadams@ci.antioch.ca.us</eventContactEmail> <eventContactPhone>925-779-7070</eventContactPhone> <displayCloseDate>true</displayCloseDate> <excludedFromEmailing>false</excludedFromEmailing> <category>Activities</category> <mediaTypes> <mediaType>Recware Activities</mediaType> </mediaTypes> <channels> <channel> <primaryChannel>false</primaryChannel> </channel> </channels> <eventCategories/> <eventDetails> <eventDetail> <eventDetailsName>Ages</eventDetailsName> <eventDetailsOrder>1</eventDetailsOrder> <eventDetailsValue>6 years - 12 years 11months</eventDetailsValue> </eventDetail> <eventDetail> <eventDetailsName>Instructor</eventDetailsName> <eventDetailsOrder>2</eventDetailsOrder> <eventDetailsValue>Nancy Roberts</eventDetailsValue> </eventDetail> <eventDetail> <eventDetailsName>Code</eventDetailsName> <eventDetailsOrder>3</eventDetailsOrder> <eventDetailsValue>1447.401</eventDetailsValue> </eventDetail> <eventDetail> <eventDetailsName>Classification</eventDetailsName> <eventDetailsOrder>4</eventDetailsOrder> <eventDetailsValue>Art</eventDetailsValue> </eventDetail> <eventDetail> <eventDetailsName>Schedule</eventDetailsName> <eventDetailsOrder>5</eventDetailsOrder> <eventDetailsValue>Occurs every week on Thursday effective 9/16/10 until 10/21/10 from 3:30 PM to 4:30 PM</eventDetailsValue> </eventDetail> </eventDetails> <eventDonationLinks/> <eventSanctions/> <eventDetailsPageUrl>http://www.active.com/page/Event_Details.htm?event_id=1877942</eventDetailsPageUrl> <eventContactUrl>http://www.active.com/event_contact.cfm?event_id=1877942</eventContactUrl> </event>'))
+ r.content.should be_an_instance_of(Array)
+ r.content[0][:title].should eql("Ages")
+ r.content[1][:title].should eql("Instructor")
+ r.content[2][:title].should eql("Code")
+ r.content[3][:title].should eql("Classification")
+ r.content[4][:title].should eql("Schedule")
+
+ r.content[0][:content].should eql("6 years - 12 years 11months")
+ r.content[1][:content].should eql("Nancy Roberts")
+ r.content[2][:content].should eql("1447.401")
+ r.content[3][:content].should eql("Art")
+ r.content[4][:content].should eql("Occurs every week on Thursday effective 9/16/10 until 10/21/10 from 3:30 PM to 4:30 PM")
+ end
+
+ it "should handle not having extra content" do
+ r = RegCenter.new(Hash.from_xml('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><event> <assetID>396e12ba-d496-4d3c-ad76-4ac581ac7628</assetID> <eventID>1893115</eventID> <eventName>San Francisco Halloween Run & Walk for Schools</eventName> <eventDate>2010-10-31T08:30:00-07:00</eventDate> <eventTime>Mile starts 8:30 AM, 5K starts 9 AM</eventTime> <eventLocation>John F. Kennedy Drive at Middle Drive in Golden Gate Park.</eventLocation> <eventCity>San Francisco</eventCity> <eventState>California</eventState> <eventZip>94117</eventZip> <eventCountry>USA</eventCountry> <briefDescription>Both the 5K and mile are USATF Certified distances that visit some of Golden Gate Park’s best views. <b>The Jefferson Mile is the 2010 RRCA California State Championship Mile. It Starts 8:30 AM</b>. <b>The 5K is flat and fast with a couple of easy hills and Starts 9 AM on JFK, East of the Conservatory of Flowers. Certified Maps at PeopleEvents.org</b></briefDescription> <eventDescription>Awards 3 deep in all divisions 8 & under to 80+ Prizes for winners, top pledge collector and random drawing. We feature online Finish Videos and post downloadable Finish Line Photos.</eventDescription> <usatSanctioned>false</usatSanctioned> <regOnline>true</regOnline> <eventCloseDate>2010-10-30T11:59:00-07:00</eventCloseDate> <eventFees>5K or Mile: $25 includes T-shirt until 10/19, $30 after<p>Combo (Mile & 5K): $30 until 10/19, $35 after<p>Kids 12 & under w/t-shirt: $15 until 10/19</eventFees> <currencyCode>USD</currencyCode> <eventTypeID>7</eventTypeID> <eventType>Event, Race</eventType> <hasEventResults>false</hasEventResults> <hasMetaResults>false</hasMetaResults> <showMap>false</showMap> <longitude>-122.4438929</longitude> <latitude>37.7717185</latitude> <eventContactEmail>Bill_Dake@peopleevents.org</eventContactEmail> <eventContactPhone>650 291-8531</eventContactPhone> <displayCloseDate>true</displayCloseDate> <excludedFromEmailing>false</excludedFromEmailing> <category>Activities</category> <mediaTypes> <mediaType>Event</mediaType> <mediaType>Event\1 mile</mediaType> <mediaType>Event\5K</mediaType> </mediaTypes> <channels> <channel> <channelName>Running</channelName> <primaryChannel>true</primaryChannel> </channel> </channels> <eventCategories/> <eventDetails> <eventDetail> <eventDetailsName>Event Flyer</eventDetailsName> <eventDetailsOrder>1</eventDetailsOrder> <eventDetailsValue><a href=http://www.eteamz.com/activeactive1/files/0913halloweenentryv5-new.pdf> Click Here to View Event Flyer</a></eventDetailsValue> </eventDetail> </eventDetails> <eventDonationLinks> <eventDonationLink> <eventDonationLinkID>158285</eventDonationLinkID> <eventDonationLinkTitle>SF Halloween Run & Walk for Schools</eventDonationLinkTitle> <eventDonationLinkUrl>http://www.active.com/donate/sfrunwalkforschools</eventDonationLinkUrl> </eventDonationLink> </eventDonationLinks> <eventSanctions/> <eventUrl>http://www.PeopleEvents.org</eventUrl> <eventDetailsPageUrl>http://www.active.com/page/Event_Details.htm?event_id=1893115</eventDetailsPageUrl> <eventContactUrl>http://www.active.com/event_contact.cfm?event_id=1893115</eventContactUrl> <eventImageUrl>http://www.active.com/images/upimages/halloween10_blk.jpg</eventImageUrl></event>'))
+ r.content.should be_an_instance_of(Array)
+ r.content[0][:title].should eql("Event Flyer")
+ r.content[0][:content].should eql("<a href=http://www.eteamz.com/activeactive1/files/0913halloweenentryv5-new.pdf> Click Here to View Event Flyer</a>")
+ end
+
+
+
+
end