r43 0.2.0 → 0.3.0

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.
@@ -0,0 +1,39 @@
1
+ <feed>
2
+ <title>Tag search results for "travel" on 43 Things</title>
3
+ <link href="http://www.43things.com/search/query?q=travel" rel="alternate" type="text/html"/>
4
+ <query>travel</query>
5
+ -
6
+ <pagination>
7
+ <offset>0</offset>
8
+ <max>20</max>
9
+ <total>159</total>
10
+ <next_offset>20</next_offset>
11
+ <previous_offset/>
12
+ </pagination>
13
+ -
14
+ <tags>
15
+ -
16
+ <tag count="1">
17
+ travel travelling europe france spain menorca mallorca work webdesign exchange flower therapy healing reiki teachings agriculture
18
+ </tag>
19
+ <tag count="1627">travel</tag>
20
+ <tag count="1">travel.</tag>
21
+ <tag count="15">travelling</tag>
22
+ <tag count="4">traveling</tag>
23
+ <tag count="1">traveled</tag>
24
+ <tag count="1">'travel'</tag>
25
+ <tag count="1">traveler</tag>
26
+ <tag count="4">travels</tag>
27
+ <tag count="1">travel!</tag>
28
+ <tag count="1">go travelling</tag>
29
+ <tag count="1">when i travel</tag>
30
+ <tag count="1">ireland travel</tag>
31
+ <tag count="1">mexico travel</tag>
32
+ <tag count="4">space travel</tag>
33
+ <tag count="1">travel texas</tag>
34
+ <tag count="1">travel tibet</tag>
35
+ <tag count="7">travel to europe</tag>
36
+ <tag count="2">wine travel</tag>
37
+ <tag count="1">travel canada</tag>
38
+ </tags>
39
+ </feed>
@@ -6,6 +6,28 @@ require 'test/unit'
6
6
  require 'r43'
7
7
  require 'stringio'
8
8
 
9
+
10
+ class Test::Unit::TestCase
11
+
12
+ def assert_includes(item, enum)
13
+ assert(enum.include?(item), "expected to find #{item}, but didn't")
14
+ end
15
+
16
+ def assert_array_of(type, array)
17
+ assert_instance_of(Array, array)
18
+ is_homogenous = array.all? do |element|
19
+ element.class == type
20
+ end
21
+ assert is_homogenous
22
+ end
23
+
24
+ def assert_number_of(type, count, enum)
25
+ assert_kind_of(Enumerable, enum)
26
+ assert_equal(count, enum.find_all{|e|e.instance_of? type}.length)
27
+ end
28
+
29
+ end
30
+
9
31
  class FakeService < R43::Service
10
32
 
11
33
  #
@@ -33,6 +55,8 @@ class FakeService < R43::Service
33
55
  "#{File.open('test/search_goals-ruby-offset20-max10.xml').read}",
34
56
  "get_goal_by_id?api_key=1234&id=255" =>
35
57
  "#{File.open('test/get_goal_by_id-255.xml').read}",
58
+ "get_goal_by_id?api_key=1234&id=533" =>
59
+ "#{File.open('test/get_goal_by_id-533.xml').read}",
36
60
  "get_goal_by_name?api_key=1234&name=Try+out+43+Things" =>
37
61
  "#{File.open('test/get_goal_by_name-255.xml').read}",
38
62
  "get_goals_similarities?api_key=1234&id=255" =>
@@ -77,6 +101,10 @@ class FakeService < R43::Service
77
101
 
78
102
  #
79
103
  # Team Methods
104
+ "get_teams_progress?api_key=1234&id=222591" =>
105
+ "#{File.open('test/get_teams_progress-222591.xml').read}",
106
+ "get_teams_progress?api_key=1234&id=7" =>
107
+ "#{File.open('test/get_teams_progress-7.xml').read}",
80
108
 
81
109
  #
82
110
  # Entry Methods
@@ -85,6 +113,20 @@ class FakeService < R43::Service
85
113
 
86
114
  #
87
115
  # Tag Methods
116
+ "search_tags?api_key=1234&q=travel" =>
117
+ "#{File.open('test/search_tags-travel.xml').read}",
118
+ "search_tags?api_key=1234&q=travel&offset=20" =>
119
+ "#{File.open('test/search_tags-travel-offset20.xml').read}",
120
+ "search_tags?api_key=1234&q=lose+weight" =>
121
+ "#{File.open('test/search_tags-lose+weight.xml').read}",
122
+ "get_tags_goals?api_key=1234&id=travel" =>
123
+ "#{File.open('test/get_tags_goals-travel.xml').read}",
124
+ "get_tags_goals?api_key=1234&id=travel&offset=20" =>
125
+ "#{File.open('test/get_tags_goals-travel-offset20.xml').read}",
126
+ "get_tags_goals?api_key=1234&id=travel&offset=80&max=10" =>
127
+ "#{File.open('test/get_tags_goals-travel-offset80-max10.xml').read}",
128
+ "get_tags_similarities?api_key=1234&id=travel" =>
129
+ "#{File.open('test/get_tags_similarities-travel.xml').read}",
88
130
 
89
131
  #
90
132
  # City Methods
@@ -92,18 +134,27 @@ class FakeService < R43::Service
92
134
  "#{File.open('test/search_cities-london.xml').read}",
93
135
  "get_city?api_key=1234&id=36" =>
94
136
  "#{File.open('test/get_city-36.xml').read}",
137
+ "get_city?api_key=1234&id=1164" =>
138
+ "#{File.open('test/get_city-1164.xml').read}",
95
139
  "get_citys_people?api_key=1234&id=1164" =>
96
140
  "#{File.open('test/get_citys_people-1164.xml').read}",
97
141
  "get_citys_people?api_key=1234&id=1164&offset=20" =>
98
142
  "#{File.open('test/get_citys_people-1164-offset20.xml').read}",
99
143
  "get_citys_people?api_key=1234&id=1164&offset=20&max=20" =>
100
- "#{File.open('test/get_citys_people-1164-offset20.xml').read}"
144
+ "#{File.open('test/get_citys_people-1164-offset20.xml').read}",
101
145
 
102
146
  #
103
147
  # Action Methods
104
148
 
105
149
  #
106
150
  # ATOM Methods
151
+
152
+ # calls on other 43 Family sites
153
+ "get_persons_tags?api_key=1234&id=Alvaro" =>
154
+ "#{File.open('test/es-get_persons_tags-Alvaro.xml').read}",
155
+ "get_person?api_key=1234&id=pate" =>
156
+ "#{File.open('test/idea-get_person-pate.xml').read}"
157
+
107
158
  }
108
159
 
109
160
 
@@ -115,11 +166,11 @@ end
115
166
 
116
167
  class FakeConnection < R43::Connection
117
168
  attr_reader :proxy_addr
118
- def initialize(key, proxy_addr=nil, proxy_port=nil,
169
+ def initialize(key, url='www.43things.com', proxy_addr=nil, proxy_port=nil,
119
170
  proxy_user=nil, proxy_pass=nil)
120
171
  super key
121
172
  @proxy_addr = proxy_addr
122
- @service = FakeService.new(key, proxy_addr, proxy_port,
173
+ @service = FakeService.new(key, url, proxy_addr, proxy_port,
123
174
  proxy_user, proxy_pass)
124
175
  end
125
176
  end
@@ -129,18 +180,6 @@ class TestConnection < Test::Unit::TestCase
129
180
  @connection = FakeConnection.new('1234')
130
181
  end
131
182
 
132
- def assert_array_of(type, array)
133
- assert_instance_of(Array, array)
134
- array.each do |element|
135
- assert_instance_of(type, element)
136
- end
137
- end
138
-
139
- def assert_number_of(type, count, enum)
140
- assert_kind_of(Enumerable, enum)
141
- assert_equal(count, enum.find_all{|e|e.instance_of? type}.length)
142
- end
143
-
144
183
  def test_key
145
184
  assert_equal('1234',@connection.service.key)
146
185
  newreq = FakeConnection.new(1234)
@@ -155,7 +194,7 @@ class TestConnection < Test::Unit::TestCase
155
194
  "controller"=>"service"},
156
195
  @connection.echo)
157
196
  # and testing it with a proxy
158
- req = FakeConnection.new(1234, "http://proxy.example.com")
197
+ req = FakeConnection.new(1234, "www", "http://proxy.example.com")
159
198
  assert_not_nil(req.proxy_addr)
160
199
  end
161
200
 
@@ -164,9 +203,35 @@ class TestConnection < Test::Unit::TestCase
164
203
  end
165
204
 
166
205
  def test_get_entry
167
- content = "It's odd to say that the objective is survival rather than huge market success. But just making it work and sticking to it is the objective I'm after. Hopefully, by making sure the product we develop is meaningful and the work set-up is friendly and fun, drudgery will be held in abeyance and the world will be positively impacted by what we do.\\n\\nAnyway, about 2-3 times a day I'm struck with some paranoid thought or shuddering fear about making sure the company is still here in 2-3 years. It's like an internal emotional tide. Here comes the wave of utter terror! There goes the tide of dread and its a cresting wave of happiness again."
206
+ entry = @connection.get_entry(33)
207
+ assert_entry_33(entry)
208
+ entry_by_number = @connection.get_entry(entry.entry_id)
209
+ assert_entry_33(entry_by_number)
210
+ entry_by_id = @connection.get_entry(entry.id)
211
+ assert_entry_33(entry_by_id)
212
+ entry_by_entry = @connection.get_entry(entry)
213
+ assert_entry_33(entry_by_entry)
168
214
 
169
215
  entry = @connection.get_entry(33)
216
+ entry.title= nil
217
+ entry.author= nil
218
+ entry.dc_subject= nil
219
+ entry.goal.goal_id = nil
220
+ entry.goal.num_registered_people= nil
221
+ entry.content= nil
222
+ entry.num_comments= nil
223
+ entry.issued= nil
224
+ entry.link= nil
225
+ entry.id= nil
226
+ entry.entry_id= nil
227
+ entry_after_mod = @connection.response.entry
228
+ assert_entry_33(entry_after_mod)
229
+ end
230
+
231
+ # custom assert for use by test_get_entry
232
+ def assert_entry_33(entry)
233
+ content = "It's odd to say that the objective is survival rather than huge market success. But just making it work and sticking to it is the objective I'm after. Hopefully, by making sure the product we develop is meaningful and the work set-up is friendly and fun, drudgery will be held in abeyance and the world will be positively impacted by what we do.\\n\\nAnyway, about 2-3 times a day I'm struck with some paranoid thought or shuddering fear about making sure the company is still here in 2-3 years. It's like an internal emotional tide. Here comes the wave of utter terror! There goes the tide of dread and its a cresting wave of happiness again."
234
+
170
235
  assert_instance_of(R43::Response, @connection.response)
171
236
  assert_array_of(Entry, @connection.response.entries)
172
237
  assert_number_of(Entry, 1, @connection.response.entries)
@@ -186,9 +251,30 @@ class TestConnection < Test::Unit::TestCase
186
251
  assert_equal("tag:43things.com:joshp:entry:33", entry.id.to_s)
187
252
  end
188
253
 
189
-
190
254
  def test_get_goal_by_id
191
255
  goal = @connection.get_goal_by_id(255)
256
+ goal_by_id = @connection.get_goal_by_id(goal.id)
257
+ goal_by_goal = @connection.get_goal_by_id(goal)
258
+ assert_goal_255(goal)
259
+ assert_goal_255(goal_by_id)
260
+ assert_goal_255(goal_by_goal)
261
+
262
+ goal_before_mods = @connection.get_goal_by_id(255)
263
+ goal_before_mods.name= nil
264
+ goal_before_mods.link= nil
265
+ goal_before_mods.num_registered_people= nil
266
+ goal_before_mods.num_unregistered_people= nil
267
+ goal_before_mods.num_say_worth_it= nil
268
+ goal_before_mods.num_say_not_worth_it= nil
269
+ goal_before_mods.percentage_worth_it= nil
270
+ goal_before_mods.tags.clear
271
+ goal_before_mods.id= nil
272
+ goal_after_mods = @connection.response.goal
273
+ assert_goal_255(goal_after_mods)
274
+ end
275
+
276
+ # custom asser for test_get_goal_by_id
277
+ def assert_goal_255(goal)
192
278
  assert_instance_of(Goal, goal)
193
279
  assert_equal("Try out 43 Things", goal.name)
194
280
  assert_equal("http://www.43things.com/things/view/255",
@@ -208,6 +294,7 @@ class TestConnection < Test::Unit::TestCase
208
294
  assert_equal("tag:43things.com:goal:255",goal.id.to_s)
209
295
  end
210
296
 
297
+
211
298
  def test_get_goal_by_name
212
299
  goal = @connection.get_goal_by_name("Try out 43 Things")
213
300
  assert_instance_of(Goal, goal)
@@ -234,45 +321,85 @@ class TestConnection < Test::Unit::TestCase
234
321
  assert_array_of(Goal, goals)
235
322
  assert_number_of(Goal, 1, goals)
236
323
  assert_equal("finish reading The Little Schemer", goals[0].name)
237
- goals = @connection.search_goals("ruby", {"offset" => 20, "max" => 10})
324
+ goals = @connection.search_goals("ruby", {:offset => 20, :max => 10})
238
325
  assert_array_of(Goal, goals)
239
326
  assert_number_of(Goal, 10, goals)
240
327
  assert_equal("Learn to program in Ruby", goals[0].name)
241
328
  end
242
329
 
243
330
  def test_get_goals_similarities
244
- goals = @connection.get_goals_similarities(255)
331
+ goal_255 = @connection.get_goal_by_id(255)
332
+ goals_by_number = @connection.get_goals_similarities(goal_255.goal_id)
333
+ goals_by_id = @connection.get_goals_similarities(goal_255.id)
334
+ goals_by_goal = @connection.get_goals_similarities(goal_255)
335
+ assert_goals_similar_to_255(goals_by_number)
336
+ assert_goals_similar_to_255(goals_by_id)
337
+ assert_goals_similar_to_255(goals_by_goal)
338
+ goals_by_goal.clear
339
+ goals_after_mod = @connection.response.goals
340
+ assert_goals_similar_to_255(goals_after_mod)
341
+ end
342
+
343
+ # custom assert for use by test_get_goals_similarities
344
+ def assert_goals_similar_to_255(goals)
245
345
  assert_array_of(Goal, goals)
346
+ assert_number_of(Goal, 5, goals)
246
347
  assert_equal(212,goals[0].goal_id)
247
348
  assert_equal("Make Firefox my default browser",goals[1].name)
248
349
  end
249
350
 
250
351
  def test_get_goals_people
251
- people = @connection.get_goals_people(533)
252
- assert_array_of(Person, people)
253
- assert_number_of(Person, 20, people)
254
- assert_equal("pate", people[0].name)
255
- people = @connection.get_goals_people(533,{"offset"=>20})
352
+ goal_533 = @connection.get_goal_by_id(533)
353
+ people = @connection.get_goals_people(goal_533.goal_id)
354
+ assert_people_of_goal_533(people)
355
+ people = @connection.get_goals_people(goal_533.id)
356
+ assert_people_of_goal_533(people)
357
+ people = @connection.get_goals_people(goal_533)
358
+ assert_people_of_goal_533(people)
359
+ people.clear
360
+ people = @connection.response.people
361
+ assert_people_of_goal_533(people)
362
+ people = @connection.get_goals_people(533,{:offset=>20})
256
363
  assert_array_of(Person, people)
257
364
  assert_number_of(Person, 5, people)
258
365
  assert_equal("Guan Yang", people[0].name)
259
366
  end
367
+
368
+ # custom assert for use by test_get_goals_people
369
+ def assert_people_of_goal_533(people)
370
+ assert_array_of(Person, people)
371
+ assert_number_of(Person, 20, people)
372
+ assert_equal("pate", people[0].name)
373
+ end
260
374
 
261
375
  def test_get_goals_entries
262
- entries = @connection.get_goals_entries(533)
263
- assert_array_of(Entry, entries)
264
- assert_number_of(Entry, 4, entries)
265
- assert_equal("pate", entries[0].author.name)
376
+ goal_533 = @connection.get_goal_by_id(533)
377
+ entries = @connection.get_goals_entries(goal_533.goal_id)
378
+ assert_entries_of_goal_533(entries)
379
+ entries = @connection.get_goals_entries(goal_533.id)
380
+ assert_entries_of_goal_533(entries)
381
+ entries = @connection.get_goals_entries(goal_533)
382
+ assert_entries_of_goal_533(entries)
383
+ entries.clear
384
+ entries = @connection.response.entries
385
+ assert_entries_of_goal_533(entries)
266
386
  entries = @connection.get_goals_entries(255, {
267
- "offset" => 20,
268
- "max" => 10,
269
- "view" => "done"
387
+ :offset => 20,
388
+ :max => 10,
389
+ :view => "done"
270
390
  })
271
391
  assert_array_of(Entry, entries)
272
392
  assert_number_of(Entry, 10, entries)
273
393
  assert_equal("iflynn",entries[0].author.name)
274
394
  end
275
395
 
396
+ # custom assert for use by test_get_goals_entries
397
+ def assert_entries_of_goal_533(entries)
398
+ assert_array_of(Entry, entries)
399
+ assert_number_of(Entry, 4, entries)
400
+ assert_equal("pate", entries[0].author.name)
401
+ end
402
+
276
403
  def test_search_people
277
404
  people = @connection.search_people("Sean")
278
405
  assert_array_of(Person, people)
@@ -317,6 +444,14 @@ class TestConnection < Test::Unit::TestCase
317
444
  assert_equal(person.flickr_username, person3.flickr_username)
318
445
  end
319
446
 
447
+ def test_get_person_idea
448
+ connection = FakeConnection.new(1234,'idea.43things.com')
449
+ person = connection.get_person('pate')
450
+ assert_instance_of(Person, person)
451
+ assert_equal("pate", person.username)
452
+ assert_equal("pate", person.name)
453
+ end
454
+
320
455
  def test_get_persons_completed_things
321
456
  person = @connection.get_persons_completed_things("erik")
322
457
  assert_instance_of(Person, person)
@@ -375,6 +510,13 @@ class TestConnection < Test::Unit::TestCase
375
510
  # TODO: test with flickr_username
376
511
  end
377
512
 
513
+ def test_get_persons_tags_es
514
+ connection = FakeConnection.new(1234, "es.43things.com")
515
+ tags = connection.get_persons_tags("Alvaro")
516
+ assert_array_of(Tag, tags)
517
+ assert_number_of(Tag, 3, tags)
518
+ end
519
+
378
520
  def test_get_persons_tag_cloud
379
521
  tags = @connection.get_persons_tag_cloud("erik")
380
522
  assert_array_of(Tag, tags)
@@ -383,6 +525,46 @@ class TestConnection < Test::Unit::TestCase
383
525
  # TODO: test with flickr_username
384
526
  end
385
527
 
528
+ def test_get_teams_progress
529
+ entries = @connection.get_teams_progress("222591")
530
+ assert_array_of(Entry, entries)
531
+ assert_number_of(Entry, 3, entries)
532
+ assert_equal("tag:43things.com:pate:entry:156413", entries[0].id.to_s)
533
+
534
+ people = @connection.response.people
535
+ assert_number_of(Person, 5, people)
536
+ assert_equal('milythael', people[2].username)
537
+
538
+ title = 'Team of 5\'s progress on "finish a 1.0 release of r43" at 43 Things'
539
+ assert_equal(title, @connection.response.title)
540
+ entries.clear
541
+ assert_number_of(Entry, 0, entries)
542
+
543
+ entries = @connection.response.entries
544
+ assert_array_of(Entry, entries)
545
+ assert_number_of(Entry, 3, entries)
546
+
547
+ title = 'Team of 3\'s progress on "start a company that survives longer than 2 years" at 43 Things'
548
+ entries = @connection.get_teams_progress("7")
549
+ people = @connection.response.people
550
+ tags = @connection.response.tags
551
+
552
+ assert_array_of(Entry, entries)
553
+ assert_array_of(Person, people)
554
+ assert_array_of(Tag, tags)
555
+
556
+ assert_number_of(Entry, 4, entries)
557
+ assert_number_of(Person, 3, people)
558
+ assert_number_of(Tag, 3, tags)
559
+
560
+ assert_equal(title, @connection.response.title)
561
+ assert_equal(16068, entries[0].to_i)
562
+ assert_equal('erik', people[1].username)
563
+ assert_equal('business', tags[2].name)
564
+
565
+ end
566
+
567
+
386
568
  def test_search_cities
387
569
  cities = @connection.search_cities("london")
388
570
  assert_instance_of(Array, cities)
@@ -393,6 +575,24 @@ class TestConnection < Test::Unit::TestCase
393
575
 
394
576
  def test_get_city
395
577
  city = @connection.get_city(36)
578
+ assert_city_36(city)
579
+ city_by_number = @connection.get_city(city.city_id)
580
+ assert_city_36(city_by_number)
581
+ city_by_city = @connection.get_city(city)
582
+ assert_city_36(city_by_city)
583
+
584
+ city = @connection.get_city(36)
585
+ city.name= nil
586
+ city.region= nil
587
+ city.country= nil
588
+ city.num_people= nil
589
+ city.goals.clear
590
+ city_after_mod = @connection.response.city
591
+ assert_city_36(city_after_mod)
592
+ end
593
+
594
+ # custom assert for use by test_get_city
595
+ def assert_city_36(city)
396
596
  assert_instance_of(R43::Response, @connection.response)
397
597
  assert_equal(1, @connection.response.cities.length)
398
598
  assert_instance_of(Array, @connection.response.cities)
@@ -405,19 +605,88 @@ class TestConnection < Test::Unit::TestCase
405
605
  end
406
606
 
407
607
  def test_get_citys_people
408
- people = @connection.get_citys_people(1164)
409
- assert_instance_of(Array, people)
410
- assert_equal("zerokarmaleft", people[5].username)
411
- people.each { |person| assert_instance_of(Person, person) }
608
+ city = @connection.get_city(1164)
609
+ people_by_number = @connection.get_citys_people(city.city_id)
610
+ assert_people_of_city_1164(people_by_number)
611
+ people_by_city = @connection.get_citys_people(city)
612
+ assert_people_of_city_1164(people_by_city)
613
+
614
+ people = @connection.get_citys_people(city)
615
+ people.clear
616
+ people_after_mod = @connection.response.people
617
+ assert_people_of_city_1164(people_after_mod)
618
+
619
+ people = @connection.get_citys_people(city)
412
620
  people += @connection.more()
413
- assert_equal(21, people.length)
621
+ assert_array_of(Person, people)
622
+ assert_number_of(Person, 21, people)
414
623
  assert_equal("JoelBlain", people[20].username)
415
624
 
416
- people = @connection.get_citys_people(1164, {"offset" => 20,"max" => 20 })
625
+ people = @connection.get_citys_people(1164, {:offset => 20,:max => 20 })
417
626
  assert_equal(1, people.length)
418
627
  assert_equal("JoelBlain", people[0].username)
419
628
  people.each { |person| assert_instance_of(Person, person) }
420
629
  end
630
+
631
+ # custom assert for use by test_get_cities_people
632
+ def assert_people_of_city_1164(people)
633
+ assert_array_of(Person, people)
634
+ assert_number_of(Person, 20, people)
635
+ assert_equal("zerokarmaleft", people[5].username)
636
+ end
637
+
638
+ def test_search_tags
639
+ tags = @connection.search_tags 'travel'
640
+ assert_array_of(Tag, tags)
641
+ assert_number_of(Tag, 20, tags)
642
+ assert_equal(1627, tags[1].count)
643
+ assert_equal('travel to europe', tags[17].name)
644
+
645
+ tags += @connection.more
646
+ assert_array_of(Tag, tags)
647
+ assert_number_of(Tag, 40, tags)
648
+ assert_equal(13, tags[33].count)
649
+ assert_equal('travel the world', tags[33].name)
650
+
651
+ tags = @connection.search_tags 'lose weight'
652
+ assert_array_of(Tag, tags)
653
+ assert_equal('lose weight', tags[2].name)
654
+ assert_equal(57, tags[2].count)
655
+
656
+ tags.clear
657
+ assert_number_of(Tag, 0, tags)
658
+ tags = @connection.response.tags
659
+ assert_array_of(Tag, tags)
660
+ assert_number_of(Tag, 20, tags)
661
+ assert_equal(1, tags[15].count)
662
+ assert_equal('losing weight', tags[3].name)
663
+ end
664
+
665
+ def test_get_tags_goals
666
+ goals = @connection.get_tags_goals 'travel'
667
+ assert_array_of(Goal, goals)
668
+ assert_number_of(Goal, 20, goals)
669
+
670
+ goals += @connection.more
671
+ assert_array_of(Goal, goals)
672
+ assert_number_of(Goal, 40, goals)
673
+
674
+ assert_equal(48, goals[0].to_i)
675
+ assert_equal(829, goals[39].to_i)
676
+
677
+ goals = @connection.get_tags_goals("travel", {:offset => 80, :max => 10})
678
+ assert_array_of(Goal, goals)
679
+ assert_number_of(Goal, 10, goals)
680
+ assert_equal(36, goals[0].to_i)
681
+ end
682
+
683
+ def test_get_tags_similarities
684
+ tags = @connection.get_tags_similarities 'travel'
685
+ assert_array_of(Tag, tags)
686
+ assert_number_of(Tag, 5, tags)
687
+ assert_equal(227, tags[0].count)
688
+ assert_equal("adventure", tags[0].name)
689
+ end
421
690
  end
422
691
 
423
692
  class TestResponse < Test::Unit::TestCase