Active 0.0.18 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/services/active_works.rb +4 -2
- data/lib/services/activity.rb +15 -10
- data/lib/services/gsa.rb +4 -2
- data/lib/services/search.rb +0 -2
- data/lib/services/validators.rb +25 -2
- data/spec/activity_spec.rb +12 -0
- data/spec/gsa_spec.rb +43 -1
- data/spec/search_spec.rb +6 -18
- data/version.txt +1 -1
- metadata +4 -4
@@ -1,11 +1,13 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'nokogiri'
|
3
|
+
require 'open-uri'
|
4
|
+
|
1
5
|
module Active
|
2
6
|
module Services
|
3
7
|
|
4
8
|
class ActiveWorksError < StandardError; end
|
5
9
|
|
6
10
|
class ActiveWorks < IActivity
|
7
|
-
require 'nokogiri'
|
8
|
-
require 'open-uri'
|
9
11
|
|
10
12
|
attr_accessor :asset_type_id
|
11
13
|
|
data/lib/services/activity.rb
CHANGED
@@ -136,9 +136,8 @@ module Active
|
|
136
136
|
# end
|
137
137
|
|
138
138
|
end
|
139
|
-
|
140
|
-
#
|
141
|
-
# ?
|
139
|
+
|
140
|
+
# returns the best address possible from the data returned by the GSA
|
142
141
|
def address
|
143
142
|
# returned_address = validated_address({})
|
144
143
|
# returned_address = @primary.address unless (@primary.nil? || @primary.address.nil?)
|
@@ -147,10 +146,8 @@ module Active
|
|
147
146
|
returned_address = @gsa.address
|
148
147
|
if @gsa.address[:address] != nil #and returned_address.city and returned_address.state and returned_address.country
|
149
148
|
return returned_address
|
150
|
-
else
|
151
|
-
if load_master
|
152
|
-
return @gsa.address
|
153
|
-
end
|
149
|
+
else
|
150
|
+
return @gsa.address if load_master
|
154
151
|
end
|
155
152
|
# returned_address = @address if @address
|
156
153
|
#
|
@@ -169,6 +166,16 @@ module Active
|
|
169
166
|
# end
|
170
167
|
# end
|
171
168
|
#
|
169
|
+
return returned_address
|
170
|
+
end
|
171
|
+
# returns the best address possible by loading other data sources
|
172
|
+
# 2. if the primary data source is unknow (ex asset_type_id is unknow ) we will return the GSA address.
|
173
|
+
# 3. if no address but we have lat/lng we'll do a reverse look up
|
174
|
+
def _address
|
175
|
+
if Validators.full_address(@gsa.address)
|
176
|
+
return @gsa.address
|
177
|
+
end
|
178
|
+
# 3. MOVE TO A PRIVATE METHOD OR A NEW CLASS
|
172
179
|
# if (returned_address["lat"]=="")
|
173
180
|
# #geocode
|
174
181
|
# geocode_url=""
|
@@ -193,9 +200,7 @@ module Active
|
|
193
200
|
# end
|
194
201
|
#
|
195
202
|
# end
|
196
|
-
# end
|
197
|
-
|
198
|
-
return returned_address
|
203
|
+
# end
|
199
204
|
end
|
200
205
|
|
201
206
|
def start_date
|
data/lib/services/gsa.rb
CHANGED
@@ -61,12 +61,12 @@ module Active
|
|
61
61
|
def address
|
62
62
|
@address = HashWithIndifferentAccess.new({
|
63
63
|
:name => @data["meta"]["location"],
|
64
|
-
:address => @data["meta"]["eventAddress"],
|
65
64
|
:city => @data["meta"]["city"],
|
66
65
|
:lat => @data["meta"]["latitude"],
|
67
66
|
:lng => @data["meta"]["longitude"],
|
68
67
|
:country => @data["meta"]["country"]
|
69
68
|
})
|
69
|
+
@address[:address] = @data["meta"]["eventAddress"] || @data["meta"]["location"] || nil
|
70
70
|
@address[:state] = @data["meta"]["eventState"] || @data["meta"]["state"]
|
71
71
|
@address[:zip] = @data["meta"]["eventZip"] || @data["meta"]["zip"]
|
72
72
|
@address
|
@@ -74,7 +74,9 @@ module Active
|
|
74
74
|
|
75
75
|
def start_date
|
76
76
|
if @data.has_key?("meta") and @data["meta"].has_key?("eventDate")
|
77
|
-
DateTime.parse @data["meta"]["eventDate"]
|
77
|
+
DateTime.parse( @data["meta"]["eventDate"] )
|
78
|
+
elsif @data.has_key?("meta") and @data["meta"].has_key?("startDate")
|
79
|
+
DateTime.parse( @data["meta"]["startDate"] )
|
78
80
|
else
|
79
81
|
nil
|
80
82
|
end
|
data/lib/services/search.rb
CHANGED
data/lib/services/validators.rb
CHANGED
@@ -1,7 +1,29 @@
|
|
1
1
|
module Active
|
2
2
|
module Services
|
3
3
|
class Validators
|
4
|
-
|
4
|
+
|
5
|
+
def self.full_address address
|
6
|
+
|
7
|
+
end
|
8
|
+
|
9
|
+
# return true or false
|
10
|
+
# very short check for 5 consecutive digits, no leading or trailing whitespace.
|
11
|
+
def self.zip(arg)
|
12
|
+
# arg ~= /\be(\w*)s\b/
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.state
|
16
|
+
true
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.city
|
20
|
+
false
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.address
|
24
|
+
false
|
25
|
+
end
|
26
|
+
|
5
27
|
STATES = [
|
6
28
|
[ "Alabama", "AL" ],
|
7
29
|
[ "Alaska", "AK" ],
|
@@ -76,7 +98,8 @@ module Active
|
|
76
98
|
return nil
|
77
99
|
end
|
78
100
|
|
79
|
-
#
|
101
|
+
# NO MODIFYING IN A VALIDATION CLASS
|
102
|
+
# !! clean zip
|
80
103
|
# (http://geekswithblogs.net/MainaD/archive/2007/12/03/117321.aspx)
|
81
104
|
def self.valid_zip(zip)
|
82
105
|
if zip!="00000" && zip.to_s.strip=~/(^\d{5}(-\d{4})?$)|(^[ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1} *\d{1}[A-Z]{1}\d{1}$)/
|
data/spec/activity_spec.rb
CHANGED
@@ -99,6 +99,18 @@ describe Activity do
|
|
99
99
|
g.address[:lat].should eql("33.2000368")
|
100
100
|
g.address[:lng].should eql("-117.2425355")
|
101
101
|
end
|
102
|
+
it "should have an address from this hash with null name and address" do
|
103
|
+
g = Activity.new(GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/cycling/san-francisco-ca/california-wine-country-bike-tours-in-october-2010","language":"en","title":"2010 California Wine Country Bike Tours in October | San \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/cycling/san-francisco-ca/california-wine-country-bike-tours-in-october-2010","summary":"","meta":{"startDate":"2010-10-10","eventDate":"2010-10-10T00:00:00-07:00","state":"California","endDate":"2010-10-22","eventLongitude":"-122.4200000","lastModifiedDateTime":"2010-08-26 02:15:54.36","splitMediaType":"Event","endTime":"0:00:00","mediaType":"Event","city":"San Francisco","google-site-verification":"","estParticipants":"2000","startTime":"0:00:00","assetId":["81A4A089-CAB5-4293-BFBF-87C74A1C6370","81a4a089-cab5-4293-bfbf-87c74a1c6370"],"eventId":"1889827","participationCriteria":"All","description":"","longitude":"-122.4200000","onlineDonationAvailable":"0","substitutionUrl":"1889827","assetName":["2010 California Wine Country Bike Tours in October","2010 California Wine Country Bike Tours in October"],"eventURL":"http://www.trektravel.com/contentpage.cfm?ID\u003d703","zip":"94101","contactPhone":"866-464-8735","eventLatitude":"37.7800000","eventState":"California","sortDate":"2000-10-10","keywords":"Event","onlineMembershipAvailable":"0","dma":"San Francisco - Oakland - San Jose","trackbackurl":"http://www.active.com/cycling/san-francisco-ca/california-wine-country-bike-tours-in-october-2010","seourl":"http://www.active.com/cycling/san-francisco-ca/california-wine-country-bike-tours-in-october-2010","country":"United States","onlineRegistrationAvailable":"0","category":"Activities","market":"San Francisco - Oakland - San Jose","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","lastModifiedDate":"2010-08-26","eventZip":"94101","UpdateDateTime":"8/18/2010 10:16:26 AM","latitude":"37.7800000","channel":"Cycling"}}')))
|
104
|
+
g.address[:name].should_not be_nil
|
105
|
+
g.address[:address].should_not be_nil
|
106
|
+
g.address[:city].should eql("San Francisco")
|
107
|
+
g.address[:state].should eql("California")
|
108
|
+
g.address[:zip].should eql("94101")
|
109
|
+
g.address[:country].should eql("United States")
|
110
|
+
g.address[:lat].should eql("37.7800000")
|
111
|
+
g.address[:lng].should eql("-122.4200000")
|
112
|
+
end
|
113
|
+
|
102
114
|
# TODO FIND OUT WHERE THIS DATA COMES FROM AND GET IT WORKING
|
103
115
|
# it "should have a partial address that it's full data doesn't live in WORKS or REGCENTER" do
|
104
116
|
# g = Activity.new(GSA.new(JSON.parse('{"language":"en", "title":"Zumba Punch Card (Adult) - Oct. (5) | Vista, CA, 92084 |", "url":"http://www.active.com/community-services-class/vista-ca/zumba-punch-card-adult-oct-5-2010", "escapedUrl":"http://www.active.com/community-services-class/vista-ca/zumba-punch-card-adult-oct-5-2010", "meta":{"city":"Vista", "assetId":"3ae995d9-5c16-4176-b44e-fa0577644ca4", "substitutionUrl":"vistarecreation/registrationmain.sdi?source=showAsset.sdi&activity_id=4900", "trackbackurl":"http://www.active.com/community-services-class/vista-ca/zumba-punch-card-adult-oct-5-2010", "onlineRegistrationAvailable":"false", "zip":"92084", "sortDate":"2000-10-02", "category":"Activities", "latitude":"33.2000368", "dma":"San Diego", "lastModifiedDate":"2010-09-29", "tags":"2348.321", "lastModifiedDateTime":"2010-09-29 16:46:43.33", "country":"United States of America", "startDate":"2010-10-02", "assetName":"Zumba Punch Card (Adult) - Oct. (5)", "summary":"People of all ages are falling in love with Zumba, one of the fastest growing dance-based fitness crazes in the country. With Zumbas easy-to-follow dance moves you receive body beautifying benefits while enjoying Latin rhythms including Salsa, Meringue, Cumbia, Reggaeton, even belly dance and hip-hop. Zumba is ", "description":"", "seourl":"http://www.active.com/community-services-class/vista-ca/zumba-punch-card-adult-oct-5-2010", "channel":"Community Services", "splitMediaType":"Class", "mediaType":"Class", "longitude":"-117.2425355", "UpdateDateTime":"8/20/2008 9:03:50 AM", "assetTypeId":"FB27C928-54DB-4ECD-B42F-482FC3C8681F", "state":"California", "keywords":""}, "summary":""}')))
|
data/spec/gsa_spec.rb
CHANGED
@@ -52,6 +52,11 @@ describe GSA do
|
|
52
52
|
@a.start_time.should_not be_nil
|
53
53
|
@a.start_time.should be_an_instance_of(DateTime)
|
54
54
|
end
|
55
|
+
it "should have a valid start date when data has meta.startDate" do
|
56
|
+
g = GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/community-services-class/belmont-ca/modern-teen-adult-2010","language":"en","title":"Modern - Teen Adult | Belmont, CA, 94002 |","url":"http://www.active.com/community-services-class/belmont-ca/modern-teen-adult-2010","summary":"active espn. Active Home | Directory | Community | eteamz | Results | Support |\u003cbr\u003e Event Directors \u0026amp; Organizers. Active.com. New beta search! \u003cb\u003e...\u003c/b\u003e ","meta":{"summary":"Barefoot dance with emphasis on floor work, release technique, and partnering. Emotion and story line are core elements in this class. Attire is loose fitting clothing any style or color.","startDate":"2010-11-03","tag":"class:10","state":"California","splitMediaType":"Class","lastModifiedDateTime":"2010-09-08 16:32:50.49","mediaType":"Class","city":"Belmont","assetId":"b06cbfb8-ff63-488c-92c6-d060680cc208","description":"","longitude":"-122.2758","substitutionUrl":"belmontparksandrecreation/registrationmain.sdi?source\u003dshowAsset.sdi\u0026activity_id\u003d3722","tags":"1510.306","assetName":"Modern - Teen Adult","zip":"94002","sortDate":"2000-11-03","keywords":"","dma":"San Francisco - Oakland - San Jose","trackbackurl":"http://www.active.com/community-services-class/belmont-ca/modern-teen-adult-2010","seourl":"http://www.active.com/community-services-class/belmont-ca/modern-teen-adult-2010","country":"United States of America","onlineRegistrationAvailable":"true","category":"Activities","assetTypeId":"FB27C928-54DB-4ECD-B42F-482FC3C8681F","lastModifiedDate":"2010-09-08","UpdateDateTime":"8/20/2008 9:03:50 AM","latitude":"37.52021","channel":"Community Services"}}'))
|
57
|
+
g.start_time.should_not be_nil
|
58
|
+
g.start_time.should eql(DateTime.parse("Wed, 03 Nov 2010 00:00:00"))
|
59
|
+
end
|
55
60
|
it "should have nil is no date" do
|
56
61
|
g = GSA.new(JSON.parse('{"title":"Calabasas Classic 2010 - 5k \u003cb\u003e10k\u003c/b\u003e Runs | Calabasas, California 91302 \u003cb\u003e...\u003c/b\u003e"}'))
|
57
62
|
g.start_time.should be_nil
|
@@ -119,5 +124,42 @@ describe GSA do
|
|
119
124
|
g.address[:lat].should eql("33.2000368")
|
120
125
|
g.address[:lng].should eql("-117.2425355")
|
121
126
|
end
|
122
|
-
|
127
|
+
it "should have a address.address" do
|
128
|
+
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":"Cycling"}}'))
|
129
|
+
|
130
|
+
g.address[:address].should eql("San Francisco Bay")
|
131
|
+
g.address[:name].should eql("San Francisco Bay")
|
132
|
+
g.address[:lat].should eql("37.78")
|
133
|
+
g.address[:zip].should eql("94101")
|
134
|
+
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","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":"Cycling"}}'))
|
135
|
+
g.address[:address].should be_nil
|
136
|
+
end
|
137
|
+
it "should have an address from this hash with null name and address" do
|
138
|
+
g = GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/cycling/san-francisco-ca/california-wine-country-bike-tours-in-october-2010","language":"en","title":"2010 California Wine Country Bike Tours in October | San \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/cycling/san-francisco-ca/california-wine-country-bike-tours-in-october-2010","summary":"","meta":{"startDate":"2010-10-10","eventDate":"2010-10-10T00:00:00-07:00","state":"California","endDate":"2010-10-22","eventLongitude":"-122.4200000","lastModifiedDateTime":"2010-08-26 02:15:54.36","splitMediaType":"Event","endTime":"0:00:00","mediaType":"Event","city":"San Francisco","google-site-verification":"","estParticipants":"2000","startTime":"0:00:00","assetId":["81A4A089-CAB5-4293-BFBF-87C74A1C6370","81a4a089-cab5-4293-bfbf-87c74a1c6370"],"eventId":"1889827","participationCriteria":"All","description":"","longitude":"-122.4200000","onlineDonationAvailable":"0","substitutionUrl":"1889827","assetName":["2010 California Wine Country Bike Tours in October","2010 California Wine Country Bike Tours in October"],"eventURL":"http://www.trektravel.com/contentpage.cfm?ID\u003d703","zip":"94101","contactPhone":"866-464-8735","eventLatitude":"37.7800000","eventState":"California","sortDate":"2000-10-10","keywords":"Event","onlineMembershipAvailable":"0","dma":"San Francisco - Oakland - San Jose","trackbackurl":"http://www.active.com/cycling/san-francisco-ca/california-wine-country-bike-tours-in-october-2010","seourl":"http://www.active.com/cycling/san-francisco-ca/california-wine-country-bike-tours-in-october-2010","country":"United States","onlineRegistrationAvailable":"0","category":"Activities","market":"San Francisco - Oakland - San Jose","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","lastModifiedDate":"2010-08-26","eventZip":"94101","UpdateDateTime":"8/18/2010 10:16:26 AM","latitude":"37.7800000","channel":"Cycling"}}'))
|
139
|
+
g.address[:name].should be_nil
|
140
|
+
g.address[:address].should be_nil
|
141
|
+
g.address[:city].should eql("San Francisco")
|
142
|
+
g.address[:state].should eql("California")
|
143
|
+
g.address[:zip].should eql("94101")
|
144
|
+
g.address[:country].should eql("United States")
|
145
|
+
g.address[:lat].should eql("37.7800000")
|
146
|
+
g.address[:lng].should eql("-122.4200000")
|
147
|
+
end
|
148
|
+
it "should have an address from this hash" do
|
149
|
+
g = GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/running/san-francisco-ca/nike-womens-marathon-2010","language":"en","title":"Nike Women\u0026#39;s Marathon | San Francisco, California 94102 \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/running/san-francisco-ca/nike-womens-marathon-2010","summary":"","meta":{"startDate":"2010-10-17","eventDate":"2010-10-17T07:00:00-07:00","location":"Union Square","tag":["event:10","Running:10"],"state":"California","eventLongitude":"-122.4212","endDate":"2010-10-17","lastModifiedDateTime":"2010-10-01 21:04:24.977","splitMediaType":["Event","Marathon"],"locationName":"Union Square","endTime":"7:00:00","mediaType":["Event","Event\\Marathon"],"city":"San Francisco","google-site-verification":"","estParticipants":"2000","startTime":"7:00:00","assetId":["715ED4EF-E4FF-42F2-B24B-2E4255649676","715ed4ef-e4ff-42f2-b24b-2e4255649676"],"eventId":"1854168","participationCriteria":"All","description":"","longitude":"-122.4212","onlineDonationAvailable":"0","substitutionUrl":"1854168","assetName":["Nike Womens Marathon","Nike Womens Marathon"],"eventURL":"http://inside.nike.com/blogs/nikerunning_events-en_US/?tags\u003dnike_womens_marathon_2010","zip":"94102","contactPhone":"866-786-6453","eventState":"California","sortDate":"2000-10-17","eventLatitude":"37.77869","keywords":"Event","onlineMembershipAvailable":"0","dma":"San Francisco - Oakland - San Jose","trackbackurl":"http://www.active.com/running/san-francisco-ca/nike-womens-marathon-2010","seourl":"http://www.active.com/running/san-francisco-ca/nike-womens-marathon-2010","country":"United States","onlineRegistrationAvailable":"false","category":"Activities","market":"San Francisco - Oakland - San Jose","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","lastModifiedDate":"2010-10-01","eventZip":"94102","UpdateDateTime":"9/22/2010 11:46:24 AM","latitude":"37.77869","channel":"Running"}}'))
|
150
|
+
g.address[:name].should eql("Union Square")
|
151
|
+
g.address[:address].should eql("Union Square")
|
152
|
+
g.address[:city].should eql("San Francisco")
|
153
|
+
g.address[:state].should eql("California")
|
154
|
+
g.address[:zip].should eql("94102")
|
155
|
+
g.address[:country].should eql("United States")
|
156
|
+
g.address[:lat].should eql("37.77869")
|
157
|
+
g.address[:lng].should eql("-122.4212")
|
158
|
+
end
|
123
159
|
end
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
data/spec/search_spec.rb
CHANGED
@@ -381,24 +381,12 @@ describe Search do
|
|
381
381
|
}
|
382
382
|
end
|
383
383
|
end
|
384
|
-
|
385
|
-
it "should find
|
386
|
-
|
387
|
-
it "should
|
388
|
-
|
389
|
-
|
390
|
-
# results = Search.search( {:channels => ['Running'], :sort => 'trending'} )
|
391
|
-
# end
|
392
|
-
|
393
|
-
it "should order by RELEVANCE"
|
394
|
-
|
395
|
-
it "should order by date DATE_ASC"
|
396
|
-
|
397
|
-
it "should order by date DATE_DESC"
|
398
|
-
|
399
|
-
it "should order by the date created" do
|
400
|
-
# results = Search.search( {:channels => ['Running'], :sort => 'created_at_asc'} )
|
401
|
-
pending
|
384
|
+
it "should find events that have online regristration"
|
385
|
+
it "should find events that do not have online regristration"
|
386
|
+
|
387
|
+
it "should have a start date" do
|
388
|
+
Search.search(:asset_id => "715ED4EF-E4FF-42F2-B24B-2E4255649676").results.first.should_not be_nil
|
389
|
+
# first.address["address"].should_not be_nil
|
402
390
|
end
|
403
391
|
|
404
392
|
end
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.21
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Active
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 53
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 21
|
10
|
+
version: 0.0.21
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jonathan Spooner, Brian Levine
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-06 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|