spec/gsa_spec.rb in Active-0.0.23 vs spec/gsa_spec.rb in Active-0.0.24
- old
+ new
@@ -174,9 +174,20 @@
it "should have a valid first and last name" do
g = GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/baseball-league/santee-ca/8th-annual-fall-baseball-classic-8s16s-2010","language":"en","title":"\u003cb\u003e8th Annual Fall Baseball Classic\u003c/b\u003e (\u003cb\u003e8\u0026#39;S\u003c/b\u003e-\u003cb\u003e16\u0026#39;S\u003c/b\u003e) | Santee \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/baseball-league/santee-ca/8th-annual-fall-baseball-classic-8s16s-2010","summary":"\u003cb\u003e...\u003c/b\u003e \u003cb\u003e8th Annual Fall Baseball Classic\u003c/b\u003e (\u003cb\u003e8\u0026#39;S\u003c/b\u003e-\u003cb\u003e16\u0026#39;S\u003c/b\u003e). \u003cb\u003e...\u003c/b\u003e Similar \u003cb\u003eBaseball\u003c/b\u003e Events. \u003cb\u003eFalls\u003c/b\u003e Little\u003cbr\u003e League - 2011 Season \u003cb\u003eFall\u003c/b\u003e City, Washington Mon, Feb 28, 2011. \u003cb\u003e...\u003c/b\u003e ","meta":{"startDate":"2010-10-02","eventDate":"2010-10-02T00:00:00-07:00","location":"Santee- SportsPlex","state":"California","endDate":"2010-10-03","eventLongitude":"-116.997","locationName":"Santee- SportsPlex","splitMediaType":"League","lastModifiedDateTime":"2010-10-03 03:13:09.84","endTime":"0:00:00","mediaType":"League","google-site-verification":"","city":"Santee","estParticipants":"2000","startTime":"0:00:00","assetId":["9FA03B5C-C1F4-4A92-BDE1-533BC219CB2D","9fa03b5c-c1f4-4a92-bde1-533bc219cb2d"],"eventId":"1879121","participationCriteria":"All","description":"","longitude":"-116.997","onlineDonationAvailable":"0","substitutionUrl":"1879121","assetName":["8th Annual Fall Baseball Classic (8\'S-16\'S)","8th Annual Fall Baseball Classic (8\'S-16\'S)"],"zip":"92071","contactPhone":"951-789-2065","eventLatitude":"32.86787","eventState":"California","sortDate":"2000-10-02","keywords":"Event","eventAddress":"9951 Riverwalk Drive","contactEmail":"brandon@tripecrownsocal.com","onlineMembershipAvailable":"0","dma":"San Diego","trackbackurl":"http://www.active.com/baseball-league/santee-ca/8th-annual-fall-baseball-classic-8s16s-2010","seourl":"http://www.active.com/baseball-league/santee-ca/8th-annual-fall-baseball-classic-8s16s-2010","country":"United States","onlineRegistrationAvailable":"false","category":"Activities","market":"San Diego","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","contactName":"Brandon Burns","lastModifiedDate":"2010-10-03","eventZip":"92071","latitude":"32.86787","UpdateDateTime":"9/22/2010 11:46:24 AM","channel":"Baseball"}}'))
g.user.first_name.should eql("Brandon")
g.user.last_name.should eql("Burns")
end
+ it "should have a valid first and last name" do
+ g = GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/baseball-league/santee-ca/8th-annual-fall-baseball-classic-8s16s-2010","language":"en","title":"\u003cb\u003e8th Annual Fall Baseball Classic\u003c/b\u003e (\u003cb\u003e8\u0026#39;S\u003c/b\u003e-\u003cb\u003e16\u0026#39;S\u003c/b\u003e) | Santee \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/baseball-league/santee-ca/8th-annual-fall-baseball-classic-8s16s-2010","summary":"\u003cb\u003e...\u003c/b\u003e \u003cb\u003e8th Annual Fall Baseball Classic\u003c/b\u003e (\u003cb\u003e8\u0026#39;S\u003c/b\u003e-\u003cb\u003e16\u0026#39;S\u003c/b\u003e). \u003cb\u003e...\u003c/b\u003e Similar \u003cb\u003eBaseball\u003c/b\u003e Events. \u003cb\u003eFalls\u003c/b\u003e Little\u003cbr\u003e League - 2011 Season \u003cb\u003eFall\u003c/b\u003e City, Washington Mon, Feb 28, 2011. \u003cb\u003e...\u003c/b\u003e ","meta":{"startDate":"2010-10-02","eventDate":"2010-10-02T00:00:00-07:00","location":"Santee- SportsPlex","state":"California","endDate":"2010-10-03","eventLongitude":"-116.997","locationName":"Santee- SportsPlex","splitMediaType":"League","lastModifiedDateTime":"2010-10-03 03:13:09.84","endTime":"0:00:00","mediaType":"League","google-site-verification":"","city":"Santee","estParticipants":"2000","startTime":"0:00:00","assetId":["9FA03B5C-C1F4-4A92-BDE1-533BC219CB2D","9fa03b5c-c1f4-4a92-bde1-533bc219cb2d"],"eventId":"1879121","participationCriteria":"All","description":"","longitude":"-116.997","onlineDonationAvailable":"0","substitutionUrl":"1879121","assetName":["8th Annual Fall Baseball Classic (8\'S-16\'S)","8th Annual Fall Baseball Classic (8\'S-16\'S)"],"zip":"92071","contactPhone":"951-789-2065","eventLatitude":"32.86787","eventState":"California","sortDate":"2000-10-02","keywords":"Event","eventAddress":"9951 Riverwalk Drive","contactEmail":"brandon@tripecrownsocal.com","onlineMembershipAvailable":"0","dma":"San Diego","trackbackurl":"http://www.active.com/baseball-league/santee-ca/8th-annual-fall-baseball-classic-8s16s-2010","seourl":"http://www.active.com/baseball-league/santee-ca/8th-annual-fall-baseball-classic-8s16s-2010","country":"United States","onlineRegistrationAvailable":"false","category":"Activities","market":"San Diego","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","contactName":"City of San Diego","lastModifiedDate":"2010-10-03","eventZip":"92071","latitude":"32.86787","UpdateDateTime":"9/22/2010 11:46:24 AM","channel":"Baseball"}}'))
+ g.user.first_name.should eql("City")
+ g.user.last_name.should eql("of San Diego")
+ end
+
+ it "should pull primary category from seo url" do
+ g = GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","language":"en","title":"Seismic Challenge 3.0 | San Francisco, California 94101 \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","summary":"","meta":{"startDate":"2010-10-02","eventDate":"2010-10-02T00:00:00-07:00","location":"San Francisco Bay","tag":"event:10","state":"California","eventLongitude":"-122.42","endDate":"2010-10-03","lastModifiedDateTime":"2010-10-04 03:08:51.65","splitMediaType":"Event","locationName":"San Francisco Bay","endTime":"0:00:00","mediaType":"Event","city":"San Francisco","google-site-verification":"","estParticipants":"2000","startTime":"0:00:00","assetId":["35A99FCB-E238-4D78-9205-96179F827CB0","35a99fcb-e238-4d78-9205-96179f827cb0"],"eventId":"1883181","participationCriteria":"All","description":"","longitude":"-122.42","onlineDonationAvailable":"0","substitutionUrl":"1883181","assetName":["Seismic Challenge 3.0","Seismic Challenge 3.0"],"eventURL":"http://greaterthanone.org/events/seismic-challenge/","zip":"94101","contactPhone":"415-487-3053","sortDate":"2000-10-02","eventState":"California","eventLatitude":"37.78","keywords":"Event","contactEmail":"eventinfo@sfaf.org","onlineMembershipAvailable":"0","dma":"San Francisco - Oakland - San Jose","trackbackurl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","seourl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","country":"United States","onlineRegistrationAvailable":"false","category":"Activities","market":"San Francisco - Oakland - San Jose","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","lastModifiedDate":"2010-10-04","eventZip":"94101","UpdateDateTime":"9/22/2010 11:46:24 AM","latitude":"37.78","channel":"Running,Cycling"}}'))
+ g.primary_category.should eql("Cycling")
+ end
+
end