powncer 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,462 @@
1
+ class Test::Unit::TestCase
2
+
3
+ def example_error
4
+ <<-JSON
5
+ {
6
+ "error": {
7
+ "status_code": 404,
8
+ "message": "Ack. Not found.",
9
+ "request": "http:\/\/api.pownce.com\/2.0\/public_notes_lists\/for\/zzzzzzz.json"
10
+ }
11
+ }
12
+ JSON
13
+ end
14
+
15
+ def example_profile_for
16
+ <<-JSON
17
+ {
18
+ "username": "jaehess",
19
+ "friend_count": 6,
20
+ "permalink": "http:\/\/pownce.com\/jaehess\/",
21
+ "fan_count": 0,
22
+ "short_name": "Jae H.",
23
+ "country": "United States",
24
+ "age": 28,
25
+ "first_name": "Jae",
26
+ "max_upload_mb": 10,
27
+ "blurb": "",
28
+ "gender": "Bloke",
29
+ "fan_of_count": 1,
30
+ "profile_photo_urls": {
31
+ "smedium_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_smedium.jpg",
32
+ "small_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_small.jpg",
33
+ "tiny_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_tiny.jpg",
34
+ "medium_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_medium.jpg",
35
+ "large_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_large.jpg"
36
+ },
37
+ "is_pro": false,
38
+ "id": 124992,
39
+ "location": ""
40
+ }
41
+ JSON
42
+ end
43
+
44
+ def example_profile_for_powncertest
45
+ <<-JSON
46
+ {
47
+ "username": "powncertest",
48
+ "friend_count": 1,
49
+ "permalink": "http:\/\/pownce.com\/powncertest\/",
50
+ "fan_count": 0,
51
+ "short_name": "Powncer T.",
52
+ "country": "United States",
53
+ "max_upload_mb": 10,
54
+ "first_name": "Powncer",
55
+ "profile_photo_urls": {
56
+ "smedium_photo_url": "http:\/\/pownce.com\/img\/user-sm.gif",
57
+ "small_photo_url": "http:\/\/pownce.com\/img\/user-s.gif",
58
+ "tiny_photo_url": "http:\/\/pownce.com\/img\/user-t.gif",
59
+ "medium_photo_url": "http:\/\/pownce.com\/img\/user-m.gif",
60
+ "large_photo_url": "http:\/\/pownce.com\/img\/user-l.gif"
61
+ },
62
+ "blurb": "",
63
+ "gender": "None of the Above",
64
+ "fan_of_count": 1,
65
+ "id": 171628,
66
+ "is_pro": false,
67
+ "location": ""
68
+ }
69
+ JSON
70
+ end
71
+
72
+ def example_profile_for_leah
73
+ <<-JSON
74
+ {
75
+ "username": "leahculver",
76
+ "friend_count": 313,
77
+ "permalink": "http:\/\/pownce.com\/leahculver\/",
78
+ "fan_count": 4283,
79
+ "short_name": "Leah C.",
80
+ "age": 25,
81
+ "max_upload_mb": 100,
82
+ "first_name": "Leah",
83
+ "profile_photo_urls": {
84
+ "smedium_photo_url": "http:\/\/pownce.com\/profile_photos\/l\/e\/a\/leahculver\/1_smedium.png",
85
+ "small_photo_url": "http:\/\/pownce.com\/profile_photos\/l\/e\/a\/leahculver\/1_small.png",
86
+ "tiny_photo_url": "http:\/\/pownce.com\/profile_photos\/l\/e\/a\/leahculver\/1_tiny.png",
87
+ "medium_photo_url": "http:\/\/pownce.com\/profile_photos\/l\/e\/a\/leahculver\/1_medium.png",
88
+ "large_photo_url": "http:\/\/pownce.com\/profile_photos\/l\/e\/a\/leahculver\/1_large.png"
89
+ },
90
+ "blurb": "Pownce co-founder and website developer.",
91
+ "fan_of_count": 10,
92
+ "id": 1,
93
+ "is_pro": true,
94
+ "location": "San Francisco"
95
+ }
96
+ JSON
97
+ end
98
+
99
+ def example_profile_for_david
100
+ <<-JSON
101
+ {
102
+ "username": "davidbenedic",
103
+ "friend_count": 1,
104
+ "permalink": "http:\/\/pownce.com\/davidbenedic\/",
105
+ "fan_count": 0,
106
+ "short_name": "David B.",
107
+ "country": "United States",
108
+ "age": 25,
109
+ "max_upload_mb": 10,
110
+ "first_name": "David",
111
+ "profile_photo_urls": {
112
+ "smedium_photo_url": "http:\/\/pownce.com\/profile_photos\/d\/a\/v\/davidbenedic\/171125_smedium.jpg",
113
+ "small_photo_url": "http:\/\/pownce.com\/profile_photos\/d\/a\/v\/davidbenedic\/171125_small.jpg",
114
+ "tiny_photo_url": "http:\/\/pownce.com\/profile_photos\/d\/a\/v\/davidbenedic\/171125_tiny.jpg",
115
+ "medium_photo_url": "http:\/\/pownce.com\/profile_photos\/d\/a\/v\/davidbenedic\/171125_medium.jpg",
116
+ "large_photo_url": "http:\/\/pownce.com\/profile_photos\/d\/a\/v\/davidbenedic\/171125_large.jpg"
117
+ },
118
+ "blurb": "",
119
+ "gender": "Gentleman",
120
+ "fan_of_count": 1,
121
+ "id": 171125,
122
+ "is_pro": false,
123
+ "location": ""
124
+ }
125
+ JSON
126
+ end
127
+
128
+ def example_friends_for
129
+ <<-JSON
130
+ {
131
+ "friends": {
132
+ "total_count": 6,
133
+ "has_prev_page": false,
134
+ "users": [
135
+ {
136
+ "username": "Shootee",
137
+ "friend_count": 6,
138
+ "permalink": "http:\/\/pownce.com\/Shootee\/",
139
+ "fan_count": 3,
140
+ "short_name": "Andrew S.",
141
+ "country": "United States",
142
+ "age": 28,
143
+ "first_name": "Andrew",
144
+ "max_upload_mb": 10,
145
+ "blurb": "",
146
+ "gender": "Guy",
147
+ "fan_of_count": 1,
148
+ "profile_photo_urls": {
149
+ "smedium_photo_url": "http:\/\/pownce.com\/profile_photos\/S\/h\/o\/Shootee\/127970_smedium.jpg",
150
+ "small_photo_url": "http:\/\/pownce.com\/profile_photos\/S\/h\/o\/Shootee\/127970_small.jpg",
151
+ "tiny_photo_url": "http:\/\/pownce.com\/profile_photos\/S\/h\/o\/Shootee\/127970_tiny.jpg",
152
+ "medium_photo_url": "http:\/\/pownce.com\/profile_photos\/S\/h\/o\/Shootee\/127970_medium.jpg",
153
+ "large_photo_url": "http:\/\/pownce.com\/profile_photos\/S\/h\/o\/Shootee\/127970_large.jpg"
154
+ },
155
+ "is_pro": false,
156
+ "id": 127970,
157
+ "location": ""
158
+ },
159
+ {
160
+ "username": "davidbenedic",
161
+ "friend_count": 1,
162
+ "permalink": "http:\/\/pownce.com\/davidbenedic\/",
163
+ "fan_count": 0,
164
+ "short_name": "David B.",
165
+ "country": "United States",
166
+ "age": 25,
167
+ "first_name": "David",
168
+ "max_upload_mb": 10,
169
+ "blurb": "",
170
+ "gender": "Gentleman",
171
+ "fan_of_count": 1,
172
+ "profile_photo_urls": {
173
+ "smedium_photo_url": "http:\/\/pownce.com\/profile_photos\/d\/a\/v\/davidbenedic\/171125_smedium.jpg",
174
+ "small_photo_url": "http:\/\/pownce.com\/profile_photos\/d\/a\/v\/davidbenedic\/171125_small.jpg",
175
+ "tiny_photo_url": "http:\/\/pownce.com\/profile_photos\/d\/a\/v\/davidbenedic\/171125_tiny.jpg",
176
+ "medium_photo_url": "http:\/\/pownce.com\/profile_photos\/d\/a\/v\/davidbenedic\/171125_medium.jpg",
177
+ "large_photo_url": "http:\/\/pownce.com\/profile_photos\/d\/a\/v\/davidbenedic\/171125_large.jpg"
178
+ },
179
+ "is_pro": false,
180
+ "id": 171125,
181
+ "location": ""
182
+ },
183
+ {
184
+ "username": "Rendered79",
185
+ "friend_count": 5,
186
+ "permalink": "http:\/\/pownce.com\/Rendered79\/",
187
+ "fan_count": 0,
188
+ "short_name": "Heath W.",
189
+ "country": "United States",
190
+ "age": 28,
191
+ "first_name": "Heath",
192
+ "max_upload_mb": 10,
193
+ "blurb": "",
194
+ "gender": "Guy",
195
+ "fan_of_count": 2,
196
+ "profile_photo_urls": {
197
+ "smedium_photo_url": "http:\/\/pownce.com\/profile_photos\/R\/e\/n\/Rendered79\/124968_smedium.png",
198
+ "small_photo_url": "http:\/\/pownce.com\/profile_photos\/R\/e\/n\/Rendered79\/124968_small.png",
199
+ "tiny_photo_url": "http:\/\/pownce.com\/profile_photos\/R\/e\/n\/Rendered79\/124968_tiny.png",
200
+ "medium_photo_url": "http:\/\/pownce.com\/profile_photos\/R\/e\/n\/Rendered79\/124968_medium.png",
201
+ "large_photo_url": "http:\/\/pownce.com\/profile_photos\/R\/e\/n\/Rendered79\/124968_large.png"
202
+ },
203
+ "is_pro": false,
204
+ "id": 124968,
205
+ "location": ""
206
+ },
207
+ {
208
+ "username": "michaelw",
209
+ "friend_count": 1,
210
+ "permalink": "http:\/\/pownce.com\/michaelw\/",
211
+ "fan_count": 1,
212
+ "short_name": "Michael W.",
213
+ "country": "United States",
214
+ "first_name": "Michael",
215
+ "max_upload_mb": 10,
216
+ "blurb": "",
217
+ "gender": "Male",
218
+ "fan_of_count": 1,
219
+ "profile_photo_urls": {
220
+ "smedium_photo_url": "http:\/\/pownce.com\/profile_photos\/m\/i\/c\/michaelw\/125258_smedium.jpg",
221
+ "small_photo_url": "http:\/\/pownce.com\/profile_photos\/m\/i\/c\/michaelw\/125258_small.jpg",
222
+ "tiny_photo_url": "http:\/\/pownce.com\/profile_photos\/m\/i\/c\/michaelw\/125258_tiny.jpg",
223
+ "medium_photo_url": "http:\/\/pownce.com\/profile_photos\/m\/i\/c\/michaelw\/125258_medium.jpg",
224
+ "large_photo_url": "http:\/\/pownce.com\/profile_photos\/m\/i\/c\/michaelw\/125258_large.jpg"
225
+ },
226
+ "is_pro": false,
227
+ "id": 125258,
228
+ "location": ""
229
+ },
230
+ {
231
+ "username": "Mukid1734",
232
+ "friend_count": 2,
233
+ "permalink": "http:\/\/pownce.com\/Mukid1734\/",
234
+ "fan_count": 0,
235
+ "short_name": "Sean D.",
236
+ "country": "United States",
237
+ "first_name": "Sean",
238
+ "max_upload_mb": 10,
239
+ "blurb": "",
240
+ "gender": "Male",
241
+ "fan_of_count": 1,
242
+ "profile_photo_urls": {
243
+ "smedium_photo_url": "http:\/\/pownce.com\/img\/user-sm.gif",
244
+ "small_photo_url": "http:\/\/pownce.com\/img\/user-s.gif",
245
+ "tiny_photo_url": "http:\/\/pownce.com\/img\/user-t.gif",
246
+ "medium_photo_url": "http:\/\/pownce.com\/img\/user-m.gif",
247
+ "large_photo_url": "http:\/\/pownce.com\/img\/user-l.gif"
248
+ },
249
+ "is_pro": false,
250
+ "id": 125050,
251
+ "location": ""
252
+ },
253
+ {
254
+ "username": "Summerhess",
255
+ "friend_count": 4,
256
+ "permalink": "http:\/\/pownce.com\/Summerhess\/",
257
+ "fan_count": 0,
258
+ "short_name": "summer h.",
259
+ "country": "United States",
260
+ "age": 29,
261
+ "first_name": "summer",
262
+ "max_upload_mb": 10,
263
+ "blurb": "",
264
+ "gender": "Female",
265
+ "fan_of_count": 1,
266
+ "profile_photo_urls": {
267
+ "smedium_photo_url": "http:\/\/pownce.com\/profile_photos\/S\/u\/m\/Summerhess\/125221_smedium.jpg",
268
+ "small_photo_url": "http:\/\/pownce.com\/profile_photos\/S\/u\/m\/Summerhess\/125221_small.jpg",
269
+ "tiny_photo_url": "http:\/\/pownce.com\/profile_photos\/S\/u\/m\/Summerhess\/125221_tiny.jpg",
270
+ "medium_photo_url": "http:\/\/pownce.com\/profile_photos\/S\/u\/m\/Summerhess\/125221_medium.jpg",
271
+ "large_photo_url": "http:\/\/pownce.com\/profile_photos\/S\/u\/m\/Summerhess\/125221_large.jpg"
272
+ },
273
+ "is_pro": false,
274
+ "id": 125221,
275
+ "location": ""
276
+ }
277
+ ],
278
+ "has_next_page": false
279
+ }
280
+ }
281
+ JSON
282
+ end
283
+
284
+ def example_public_note_for
285
+ <<-JSON
286
+ {
287
+ "body": "Powncer Ruby Gem released soon (with API 2.0 support)",
288
+ "permalink": "http:\/\/pownce.com\/jaehess\/notes\/1437687\/",
289
+ "sender": {
290
+ "username": "jaehess",
291
+ "friend_count": 6,
292
+ "permalink": "http:\/\/pownce.com\/jaehess\/",
293
+ "fan_count": 0,
294
+ "short_name": "Jae H.",
295
+ "country": "United States",
296
+ "age": 28,
297
+ "first_name": "Jae",
298
+ "max_upload_mb": 10,
299
+ "blurb": "",
300
+ "gender": "Bloke",
301
+ "fan_of_count": 1,
302
+ "profile_photo_urls": {
303
+ "smedium_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_smedium.jpg",
304
+ "small_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_small.jpg",
305
+ "tiny_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_tiny.jpg",
306
+ "medium_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_medium.jpg",
307
+ "large_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_large.jpg"
308
+ },
309
+ "is_pro": false,
310
+ "location": ""
311
+ },
312
+ "num_replies": "0",
313
+ "display_since": "3 min ago",
314
+ "timestamp": 1204321981,
315
+ "seconds_since": 448,
316
+ "num_recipients": "6",
317
+ "stars": "0.0",
318
+ "is_public": true,
319
+ "type": "message",
320
+ "id": 1437687,
321
+ "is_private": false
322
+ }
323
+ JSON
324
+ end
325
+
326
+ def example_public_notes_for(length=20)
327
+ <<-JSON
328
+ {
329
+ "notes": [#{Array.new(length).fill(example_public_note_for).join(",")}]
330
+ }
331
+ JSON
332
+ end
333
+
334
+ def example_public_notes(length=20, page=1)
335
+ # This might not be needed to be called ever in a seperate mock
336
+ # For now, it is seperated
337
+ example_public_notes_for(length)
338
+ end
339
+
340
+ def example_public_messages
341
+ example_public_notes(20)
342
+ end
343
+
344
+ def example_public_link_for
345
+ <<-JSON
346
+ {
347
+ "body": "Just generating a test link for powncer testing",
348
+ "permalink": "http:\/\/pownce.com\/jaehess\/notes\/1438389\/",
349
+ "sender": {
350
+ "username": "jaehess",
351
+ "friend_count": 6,
352
+ "permalink": "http:\/\/pownce.com\/jaehess\/",
353
+ "fan_count": 0,
354
+ "short_name": "Jae H.",
355
+ "country": "United States",
356
+ "age": 28,
357
+ "first_name": "Jae",
358
+ "max_upload_mb": 10,
359
+ "blurb": "",
360
+ "gender": "Bloke",
361
+ "fan_of_count": 3,
362
+ "profile_photo_urls": {
363
+ "smedium_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_smedium.jpg",
364
+ "small_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_small.jpg",
365
+ "tiny_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_tiny.jpg",
366
+ "medium_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_medium.jpg",
367
+ "large_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_large.jpg"
368
+ },
369
+ "is_pro": false,
370
+ "location": ""
371
+ },
372
+ "num_replies": "0",
373
+ "display_since": "2 min ago",
374
+ "timestamp": 1204334709,
375
+ "seconds_since": 284,
376
+ "num_recipients": "6",
377
+ "link": {
378
+ "url": "http:\/\/www.rubyforge.org\/projects\/powncer"
379
+ },
380
+ "stars": "0.0",
381
+ "is_public": true,
382
+ "type": "link",
383
+ "id": 1438389,
384
+ "is_private": false
385
+ }
386
+ JSON
387
+ end
388
+
389
+ def example_public_links_for
390
+ <<-JSON
391
+ {
392
+ "notes": [#{example_public_link_for}]
393
+ }
394
+ JSON
395
+ end
396
+
397
+ def example_public_links
398
+ <<-JSON
399
+ {
400
+ "notes": [#{Array.new(20).fill(example_public_link_for).join(",")}]
401
+ }
402
+ JSON
403
+ end
404
+
405
+ def example_public_event_for
406
+ <<-JSON
407
+ {
408
+ "body": "Just generating a test event for powncer testing",
409
+ "permalink": "http:\/\/pownce.com\/jaehess\/notes\/1438496\/",
410
+ "sender": {
411
+ "username": "jaehess",
412
+ "friend_count": 6,
413
+ "permalink": "http:\/\/pownce.com\/jaehess\/",
414
+ "fan_count": 0,
415
+ "short_name": "Jae H.",
416
+ "country": "United States",
417
+ "age": 28,
418
+ "first_name": "Jae",
419
+ "max_upload_mb": 10,
420
+ "location": "",
421
+ "gender": "Bloke",
422
+ "fan_of_count": 3,
423
+ "profile_photo_urls": {
424
+ "smedium_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_smedium.jpg",
425
+ "small_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_small.jpg",
426
+ "tiny_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_tiny.jpg",
427
+ "medium_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_medium.jpg",
428
+ "large_photo_url": "http:\/\/pownce.com\/profile_photos\/j\/a\/e\/jaehess\/124992_large.jpg"
429
+ },
430
+ "is_pro": false
431
+ },
432
+ "num_replies": "0",
433
+ "display_since": "just now!",
434
+ "timestamp": 1204337114,
435
+ "event": {
436
+ "name": "Test Event for Powncer",
437
+ "google_map_url": "http:\/\/maps.google.com\/maps?q=http%3A%2F%2Frubyforge.org%2Fproject%2Fpowncer",
438
+ "ical": "http:\/\/pownce.com\/ical\/event\/17399",
439
+ "location": "http:\/\/rubyforge.org\/project\/powncer",
440
+ "date": "2008-03-06 20:00:00",
441
+ "yahoo_map_url": "http:\/\/maps.yahoo.com\/maps_result.php?q1=http%3A%2F%2Frubyforge.org%2Fproject%2Fpowncer"
442
+ },
443
+ "seconds_since": 23,
444
+ "num_recipients": "6",
445
+ "stars": "0.0",
446
+ "is_public": true,
447
+ "type": "event",
448
+ "id": 1438496,
449
+ "is_private": false
450
+ }
451
+ JSON
452
+ end
453
+
454
+ def example_public_events
455
+ <<-JSON
456
+ {
457
+ "notes": [#{Array.new(20).fill(example_public_event_for).join(",")}]
458
+ }
459
+ JSON
460
+ end
461
+
462
+ end