big-door 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/.bundle/config +2 -0
  2. data/.document +5 -0
  3. data/.gitignore +22 -0
  4. data/Gemfile +12 -0
  5. data/LICENSE +20 -0
  6. data/README.rdoc +17 -0
  7. data/Rakefile +59 -0
  8. data/VERSION +1 -0
  9. data/features/big-door.feature +26 -0
  10. data/features/step_definitions/big-door_steps.rb +83 -0
  11. data/features/support/env.rb +5 -0
  12. data/lib/big-door.rb +127 -0
  13. data/lib/big-door/base.rb +45 -0
  14. data/lib/big-door/currency.rb +25 -0
  15. data/lib/big-door/named_transaction.rb +25 -0
  16. data/lib/big-door/named_transaction_group.rb +27 -0
  17. data/lib/big-door/request.rb +7 -0
  18. data/lib/big-door/response_codes.rb +266 -0
  19. data/lib/big-door/user.rb +49 -0
  20. data/spec/.rspec +1 -0
  21. data/spec/big-door_spec.rb +105 -0
  22. data/spec/spec_helper.rb +19 -0
  23. data/spec/support/vcr.rb +7 -0
  24. data/vcr_cassettes/NamedTransaction/NamedTransaction.yml +213 -0
  25. data/vcr_cassettes/NamedTransaction/specific.yml +6043 -0
  26. data/vcr_cassettes/award/award_summary.yml +34 -0
  27. data/vcr_cassettes/currency/currency.yml +52 -0
  28. data/vcr_cassettes/currency/currency_type.yml +31 -0
  29. data/vcr_cassettes/currency/specific.yml +2980 -0
  30. data/vcr_cassettes/good/good_summary.yml +34 -0
  31. data/vcr_cassettes/level/level_summary.yml +34 -0
  32. data/vcr_cassettes/named_transaction/named_transactions.yml +107 -0
  33. data/vcr_cassettes/named_transaction_group/all.yml +145 -0
  34. data/vcr_cassettes/named_transaction_group/specific.yml +3171 -0
  35. data/vcr_cassettes/user/add_points.yml +36 -0
  36. data/vcr_cassettes/user/all.yml +473 -0
  37. data/vcr_cassettes/user/create.yml +393 -0
  38. data/vcr_cassettes/user/currency_balance.yml +738 -0
  39. data/vcr_cassettes/user/new.yml +5660 -0
  40. data/vcr_cassettes/user/new_currency_balance.yml +470 -0
  41. data/vcr_cassettes/user/specific.yml +213 -0
  42. metadata +175 -0
@@ -0,0 +1,470 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: http://api.bigdoor.com:80/api/publisher/0d38d9cd41b0440bbf22c0720be58b27/end_user/tester/currency_balance?time=1282767045.94&format=json&sig=330ab7b9fb2aa1d2ee1c4d09f4cce16cae60857da855cf693cb03ab02eac501d
6
+ body:
7
+ headers:
8
+ connection:
9
+ - close
10
+ host:
11
+ - api.bigdoor.com
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ connection:
18
+ - Close
19
+ content-type:
20
+ - application/json; charset=utf-8
21
+ server:
22
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_wsgi/2.5 Python/2.5.2
23
+ date:
24
+ - Wed, 25 Aug 2010 20:10:46 GMT
25
+ content-length:
26
+ - "1343"
27
+ vary:
28
+ - Authorization,Cookie
29
+ body: |-
30
+ [
31
+ [
32
+ {
33
+ "end_user_description": null,
34
+ "read_only": 0,
35
+ "modified_timestamp": 1282767045,
36
+ "pub_title": "temp_points",
37
+ "transaction_group_id": "702e26b7dfa254fd4311f656c8751225",
38
+ "adjustment_amount": "30.00",
39
+ "id": 10215423,
40
+ "currency": {
41
+ "end_user_description": null,
42
+ "read_only": 0,
43
+ "modified_timestamp": 1281974693,
44
+ "pub_title": "temp_points",
45
+ "currency_type_title": "Skill Points",
46
+ "currency_type_id": 9,
47
+ "exchange_rate": "1.00",
48
+ "resource_name": "currency",
49
+ "urls": [],
50
+ "created_timestamp": 1281974693,
51
+ "pub_description": null,
52
+ "end_user_title": "Temp Points",
53
+ "relative_weight": 1,
54
+ "id": 579,
55
+ "currency_type_description": ""
56
+ },
57
+ "prev_balance": "300.00",
58
+ "resource_name": "end_user_currency_balance",
59
+ "created_timestamp": 1282752987,
60
+ "pub_description": null,
61
+ "end_user_title": "Temp Points",
62
+ "end_user_login": "tester",
63
+ "curr_balance": "330.00"
64
+ }
65
+ ],
66
+ {}
67
+ ]
68
+ http_version: "1.1"
69
+ - !ruby/struct:VCR::HTTPInteraction
70
+ request: !ruby/struct:VCR::Request
71
+ method: :get
72
+ uri: http://api.bigdoor.com:80/api/publisher/0d38d9cd41b0440bbf22c0720be58b27/end_user/tester/currency_balance?time=1282767072.44&format=json&sig=234bd1f76752a9cfe51fb3b187bf9cd566956e5a4efa9ad8db0aa22994430d7c
73
+ body:
74
+ headers:
75
+ connection:
76
+ - close
77
+ host:
78
+ - api.bigdoor.com
79
+ response: !ruby/struct:VCR::Response
80
+ status: !ruby/struct:VCR::ResponseStatus
81
+ code: 200
82
+ message: OK
83
+ headers:
84
+ content-type:
85
+ - application/json; charset=utf-8
86
+ connection:
87
+ - Close
88
+ date:
89
+ - Wed, 25 Aug 2010 20:11:13 GMT
90
+ server:
91
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_wsgi/2.5 Python/2.5.2
92
+ content-length:
93
+ - "1343"
94
+ vary:
95
+ - Authorization,Cookie
96
+ body: |-
97
+ [
98
+ [
99
+ {
100
+ "end_user_description": null,
101
+ "read_only": 0,
102
+ "modified_timestamp": 1282767072,
103
+ "pub_title": "temp_points",
104
+ "transaction_group_id": "11d76bb5aa2e6f957dcbbefeea1113ac",
105
+ "adjustment_amount": "30.00",
106
+ "id": 10215423,
107
+ "currency": {
108
+ "end_user_description": null,
109
+ "read_only": 0,
110
+ "modified_timestamp": 1281974693,
111
+ "pub_title": "temp_points",
112
+ "currency_type_title": "Skill Points",
113
+ "currency_type_id": 9,
114
+ "exchange_rate": "1.00",
115
+ "resource_name": "currency",
116
+ "urls": [],
117
+ "created_timestamp": 1281974693,
118
+ "pub_description": null,
119
+ "end_user_title": "Temp Points",
120
+ "relative_weight": 1,
121
+ "id": 579,
122
+ "currency_type_description": ""
123
+ },
124
+ "prev_balance": "330.00",
125
+ "resource_name": "end_user_currency_balance",
126
+ "created_timestamp": 1282752987,
127
+ "pub_description": null,
128
+ "end_user_title": "Temp Points",
129
+ "end_user_login": "tester",
130
+ "curr_balance": "360.00"
131
+ }
132
+ ],
133
+ {}
134
+ ]
135
+ http_version: "1.1"
136
+ - !ruby/struct:VCR::HTTPInteraction
137
+ request: !ruby/struct:VCR::Request
138
+ method: :get
139
+ uri: http://api.bigdoor.com:80/api/publisher/0d38d9cd41b0440bbf22c0720be58b27/end_user/tester/currency_balance?time=1282767111.94&format=json&sig=0b17fb3d01e1c6a460349250173c71f11b04fb4894eb2dc929fe6122406b27e4
140
+ body:
141
+ headers:
142
+ connection:
143
+ - close
144
+ host:
145
+ - api.bigdoor.com
146
+ response: !ruby/struct:VCR::Response
147
+ status: !ruby/struct:VCR::ResponseStatus
148
+ code: 200
149
+ message: OK
150
+ headers:
151
+ connection:
152
+ - Close
153
+ content-type:
154
+ - application/json; charset=utf-8
155
+ server:
156
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_wsgi/2.5 Python/2.5.2
157
+ date:
158
+ - Wed, 25 Aug 2010 20:11:52 GMT
159
+ content-length:
160
+ - "1343"
161
+ vary:
162
+ - Authorization,Cookie
163
+ body: |-
164
+ [
165
+ [
166
+ {
167
+ "end_user_description": null,
168
+ "read_only": 0,
169
+ "modified_timestamp": 1282767107,
170
+ "pub_title": "temp_points",
171
+ "transaction_group_id": "dcaa7ff6bdfee3a0bfb2704e9aa8953a",
172
+ "adjustment_amount": "30.00",
173
+ "id": 10215423,
174
+ "currency": {
175
+ "end_user_description": null,
176
+ "read_only": 0,
177
+ "modified_timestamp": 1281974693,
178
+ "pub_title": "temp_points",
179
+ "currency_type_title": "Skill Points",
180
+ "currency_type_id": 9,
181
+ "exchange_rate": "1.00",
182
+ "resource_name": "currency",
183
+ "urls": [],
184
+ "created_timestamp": 1281974693,
185
+ "pub_description": null,
186
+ "end_user_title": "Temp Points",
187
+ "relative_weight": 1,
188
+ "id": 579,
189
+ "currency_type_description": ""
190
+ },
191
+ "prev_balance": "360.00",
192
+ "resource_name": "end_user_currency_balance",
193
+ "created_timestamp": 1282752987,
194
+ "pub_description": null,
195
+ "end_user_title": "Temp Points",
196
+ "end_user_login": "tester",
197
+ "curr_balance": "390.00"
198
+ }
199
+ ],
200
+ {}
201
+ ]
202
+ http_version: "1.1"
203
+ - !ruby/struct:VCR::HTTPInteraction
204
+ request: !ruby/struct:VCR::Request
205
+ method: :get
206
+ uri: http://api.bigdoor.com:80/api/publisher/0d38d9cd41b0440bbf22c0720be58b27/end_user/tester/currency_balance?time=1282767186.96&format=json&sig=11215ef8e43e16ae5c5d74973a3b302e26c0e32b9e69569b8a9dff5c50faaa45
207
+ body:
208
+ headers:
209
+ connection:
210
+ - close
211
+ host:
212
+ - api.bigdoor.com
213
+ response: !ruby/struct:VCR::Response
214
+ status: !ruby/struct:VCR::ResponseStatus
215
+ code: 200
216
+ message: OK
217
+ headers:
218
+ content-type:
219
+ - application/json; charset=utf-8
220
+ connection:
221
+ - Close
222
+ date:
223
+ - Wed, 25 Aug 2010 20:13:07 GMT
224
+ server:
225
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_wsgi/2.5 Python/2.5.2
226
+ content-length:
227
+ - "1343"
228
+ vary:
229
+ - Authorization,Cookie
230
+ body: |-
231
+ [
232
+ [
233
+ {
234
+ "end_user_description": null,
235
+ "read_only": 0,
236
+ "modified_timestamp": 1282767186,
237
+ "pub_title": "temp_points",
238
+ "transaction_group_id": "aac24faf35bb5a01a34daeb7e34f44c9",
239
+ "adjustment_amount": "30.00",
240
+ "id": 10215423,
241
+ "currency": {
242
+ "end_user_description": null,
243
+ "read_only": 0,
244
+ "modified_timestamp": 1281974693,
245
+ "pub_title": "temp_points",
246
+ "currency_type_title": "Skill Points",
247
+ "currency_type_id": 9,
248
+ "exchange_rate": "1.00",
249
+ "resource_name": "currency",
250
+ "urls": [],
251
+ "created_timestamp": 1281974693,
252
+ "pub_description": null,
253
+ "end_user_title": "Temp Points",
254
+ "relative_weight": 1,
255
+ "id": 579,
256
+ "currency_type_description": ""
257
+ },
258
+ "prev_balance": "390.00",
259
+ "resource_name": "end_user_currency_balance",
260
+ "created_timestamp": 1282752987,
261
+ "pub_description": null,
262
+ "end_user_title": "Temp Points",
263
+ "end_user_login": "tester",
264
+ "curr_balance": "420.00"
265
+ }
266
+ ],
267
+ {}
268
+ ]
269
+ http_version: "1.1"
270
+ - !ruby/struct:VCR::HTTPInteraction
271
+ request: !ruby/struct:VCR::Request
272
+ method: :get
273
+ uri: http://api.bigdoor.com:80/api/publisher/0d38d9cd41b0440bbf22c0720be58b27/end_user/tester/currency_balance?time=1282767205.75&format=json&sig=14acf16a77db45994db5ca942b1630e1ea92b3f9f69e75e9055f97621e1b966f
274
+ body:
275
+ headers:
276
+ connection:
277
+ - close
278
+ host:
279
+ - api.bigdoor.com
280
+ response: !ruby/struct:VCR::Response
281
+ status: !ruby/struct:VCR::ResponseStatus
282
+ code: 200
283
+ message: OK
284
+ headers:
285
+ connection:
286
+ - Close
287
+ content-type:
288
+ - application/json; charset=utf-8
289
+ server:
290
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_wsgi/2.5 Python/2.5.2
291
+ date:
292
+ - Wed, 25 Aug 2010 20:13:25 GMT
293
+ content-length:
294
+ - "1343"
295
+ vary:
296
+ - Authorization,Cookie
297
+ body: |-
298
+ [
299
+ [
300
+ {
301
+ "end_user_description": null,
302
+ "read_only": 0,
303
+ "modified_timestamp": 1282767205,
304
+ "pub_title": "temp_points",
305
+ "transaction_group_id": "a64891b11d76f0456eb69b5ad9c1d49c",
306
+ "adjustment_amount": "30.00",
307
+ "id": 10215423,
308
+ "currency": {
309
+ "end_user_description": null,
310
+ "read_only": 0,
311
+ "modified_timestamp": 1281974693,
312
+ "pub_title": "temp_points",
313
+ "currency_type_title": "Skill Points",
314
+ "currency_type_id": 9,
315
+ "exchange_rate": "1.00",
316
+ "resource_name": "currency",
317
+ "urls": [],
318
+ "created_timestamp": 1281974693,
319
+ "pub_description": null,
320
+ "end_user_title": "Temp Points",
321
+ "relative_weight": 1,
322
+ "id": 579,
323
+ "currency_type_description": ""
324
+ },
325
+ "prev_balance": "420.00",
326
+ "resource_name": "end_user_currency_balance",
327
+ "created_timestamp": 1282752987,
328
+ "pub_description": null,
329
+ "end_user_title": "Temp Points",
330
+ "end_user_login": "tester",
331
+ "curr_balance": "450.00"
332
+ }
333
+ ],
334
+ {}
335
+ ]
336
+ http_version: "1.1"
337
+ - !ruby/struct:VCR::HTTPInteraction
338
+ request: !ruby/struct:VCR::Request
339
+ method: :get
340
+ uri: http://api.bigdoor.com:80/api/publisher/0d38d9cd41b0440bbf22c0720be58b27/end_user/tester/currency_balance?time=1282767222.73&format=json&sig=3d5a2f0a8370159ad774ad4f2fee70c62c8df3798072343c671958b48037ada9
341
+ body:
342
+ headers:
343
+ connection:
344
+ - close
345
+ host:
346
+ - api.bigdoor.com
347
+ response: !ruby/struct:VCR::Response
348
+ status: !ruby/struct:VCR::ResponseStatus
349
+ code: 200
350
+ message: OK
351
+ headers:
352
+ content-type:
353
+ - application/json; charset=utf-8
354
+ connection:
355
+ - Close
356
+ date:
357
+ - Wed, 25 Aug 2010 20:13:42 GMT
358
+ server:
359
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_wsgi/2.5 Python/2.5.2
360
+ content-length:
361
+ - "1343"
362
+ vary:
363
+ - Authorization,Cookie
364
+ body: |-
365
+ [
366
+ [
367
+ {
368
+ "end_user_description": null,
369
+ "read_only": 0,
370
+ "modified_timestamp": 1282767222,
371
+ "pub_title": "temp_points",
372
+ "transaction_group_id": "d64087569efdde6f93cc897d699e9f8d",
373
+ "adjustment_amount": "30.00",
374
+ "id": 10215423,
375
+ "currency": {
376
+ "end_user_description": null,
377
+ "read_only": 0,
378
+ "modified_timestamp": 1281974693,
379
+ "pub_title": "temp_points",
380
+ "currency_type_title": "Skill Points",
381
+ "currency_type_id": 9,
382
+ "exchange_rate": "1.00",
383
+ "resource_name": "currency",
384
+ "urls": [],
385
+ "created_timestamp": 1281974693,
386
+ "pub_description": null,
387
+ "end_user_title": "Temp Points",
388
+ "relative_weight": 1,
389
+ "id": 579,
390
+ "currency_type_description": ""
391
+ },
392
+ "prev_balance": "450.00",
393
+ "resource_name": "end_user_currency_balance",
394
+ "created_timestamp": 1282752987,
395
+ "pub_description": null,
396
+ "end_user_title": "Temp Points",
397
+ "end_user_login": "tester",
398
+ "curr_balance": "480.00"
399
+ }
400
+ ],
401
+ {}
402
+ ]
403
+ http_version: "1.1"
404
+ - !ruby/struct:VCR::HTTPInteraction
405
+ request: !ruby/struct:VCR::Request
406
+ method: :get
407
+ uri: http://api.bigdoor.com:80/api/publisher/0d38d9cd41b0440bbf22c0720be58b27/end_user/tester/currency_balance?time=1282839856.26&format=json&sig=919435c95e697c166a072a74bef062a761bde64913fefa87a0a46fda5d55bbcf
408
+ body:
409
+ headers:
410
+ connection:
411
+ - close
412
+ host:
413
+ - api.bigdoor.com
414
+ response: !ruby/struct:VCR::Response
415
+ status: !ruby/struct:VCR::ResponseStatus
416
+ code: 200
417
+ message: OK
418
+ headers:
419
+ connection:
420
+ - Close
421
+ content-type:
422
+ - application/json; charset=utf-8
423
+ server:
424
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_wsgi/2.5 Python/2.5.2
425
+ date:
426
+ - Thu, 26 Aug 2010 16:24:16 GMT
427
+ content-length:
428
+ - "1343"
429
+ vary:
430
+ - Authorization,Cookie
431
+ body: |-
432
+ [
433
+ [
434
+ {
435
+ "end_user_description": null,
436
+ "read_only": 0,
437
+ "modified_timestamp": 1282839855,
438
+ "pub_title": "temp_points",
439
+ "transaction_group_id": "fc525f3d2d6febd71dcbf40cec2fe054",
440
+ "adjustment_amount": "30.00",
441
+ "id": 10215423,
442
+ "currency": {
443
+ "end_user_description": null,
444
+ "read_only": 0,
445
+ "modified_timestamp": 1281974693,
446
+ "pub_title": "temp_points",
447
+ "currency_type_title": "Skill Points",
448
+ "currency_type_id": 9,
449
+ "exchange_rate": "1.00",
450
+ "resource_name": "currency",
451
+ "urls": [],
452
+ "created_timestamp": 1281974693,
453
+ "pub_description": null,
454
+ "end_user_title": "Temp Points",
455
+ "relative_weight": 1,
456
+ "id": 579,
457
+ "currency_type_description": ""
458
+ },
459
+ "prev_balance": "480.00",
460
+ "resource_name": "end_user_currency_balance",
461
+ "created_timestamp": 1282752987,
462
+ "pub_description": null,
463
+ "end_user_title": "Temp Points",
464
+ "end_user_login": "tester",
465
+ "curr_balance": "510.00"
466
+ }
467
+ ],
468
+ {}
469
+ ]
470
+ http_version: "1.1"