apirunner 0.5.0 → 0.5.5
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/README.rdoc +302 -33
- data/VERSION +1 -1
- data/apirunner.gemspec +2 -17
- data/examples/config/api_runner.yml +2 -2
- data/examples/test/api_runner/001_create_user.yml +199 -112
- data/lib/api_runner.rb +3 -3
- data/lib/apirunner/railtie.rb +6 -5
- data/lib/result.rb +2 -1
- data/lib/tasks/api.rake +7 -0
- data/spec/api_runner_spec.rb +1 -1
- metadata +4 -19
- data/examples/test/api_runner/002_update_resources.yml +0 -360
- data/examples/test/api_runner/003_update_ratings.yml +0 -88
- data/examples/test/api_runner/004_update_series_ratings.yml +0 -88
- data/examples/test/api_runner/005_rateables_and_pagination.yml +0 -34
- data/examples/test/api_runner/006_recommendations.yml +0 -78
- data/examples/test/api_runner/007_item_predictions.yml +0 -286
- data/examples/test/api_runner/008_discovery.yml +0 -299
- data/examples/test/api_runner/009_cacheable_operations.yml +0 -1
- data/examples/test/api_runner/010_fsk.yml +0 -168
- data/examples/test/api_runner/011_misc.yml +0 -116
- data/examples/test/api_runner/012_telekom_error_reports.yml +0 -1831
- data/examples/test/api_runner/013-extended-unpersonalized-discovery.yml +0 -711
- data/examples/test/api_runner/014-extended-personalized-discovery.yml +0 -764
- data/examples/test/api_runner/015_create_10000_users.yml +0 -43
- data/examples/test/api_runner/999_delete_user.yml +0 -78
data/spec/api_runner_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe 'apirunner' do
|
|
10
10
|
describe 'initialize' do
|
11
11
|
it 'should fill all instance variables properly' do
|
12
12
|
@a.instance_variable_get(:@spec).should be_a(Array)
|
13
|
-
@a.instance_variable_get(:@spec).size.should ==
|
13
|
+
@a.instance_variable_get(:@spec).size.should == 167
|
14
14
|
@a.instance_variable_get(:@results).should be_a(Array)
|
15
15
|
@a.instance_variable_get(:@results).size.should == 0
|
16
16
|
@a.instance_variable_get(:@configuration).should be_a(ApiConfiguration)
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 0.5.
|
8
|
+
- 5
|
9
|
+
version: 0.5.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- jan@moviepilot.com
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-03-30 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -248,21 +248,6 @@ files:
|
|
248
248
|
- changelog.txt
|
249
249
|
- examples/config/api_runner.yml
|
250
250
|
- examples/test/api_runner/001_create_user.yml
|
251
|
-
- examples/test/api_runner/002_update_resources.yml
|
252
|
-
- examples/test/api_runner/003_update_ratings.yml
|
253
|
-
- examples/test/api_runner/004_update_series_ratings.yml
|
254
|
-
- examples/test/api_runner/005_rateables_and_pagination.yml
|
255
|
-
- examples/test/api_runner/006_recommendations.yml
|
256
|
-
- examples/test/api_runner/007_item_predictions.yml
|
257
|
-
- examples/test/api_runner/008_discovery.yml
|
258
|
-
- examples/test/api_runner/009_cacheable_operations.yml
|
259
|
-
- examples/test/api_runner/010_fsk.yml
|
260
|
-
- examples/test/api_runner/011_misc.yml
|
261
|
-
- examples/test/api_runner/012_telekom_error_reports.yml
|
262
|
-
- examples/test/api_runner/013-extended-unpersonalized-discovery.yml
|
263
|
-
- examples/test/api_runner/014-extended-personalized-discovery.yml
|
264
|
-
- examples/test/api_runner/015_create_10000_users.yml
|
265
|
-
- examples/test/api_runner/999_delete_user.yml
|
266
251
|
- examples/test/api_runner/excludes.yml
|
267
252
|
- features/apirunner.feature
|
268
253
|
- features/step_definitions/apirunner_steps.rb
|
@@ -309,7 +294,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
309
294
|
requirements:
|
310
295
|
- - ">="
|
311
296
|
- !ruby/object:Gem::Version
|
312
|
-
hash: -
|
297
|
+
hash: -1941369445126853283
|
313
298
|
segments:
|
314
299
|
- 0
|
315
300
|
version: "0"
|
@@ -1,360 +0,0 @@
|
|
1
|
-
---
|
2
|
-
- name: 'Update existing user - update watchlist'
|
3
|
-
request:
|
4
|
-
headers:
|
5
|
-
Content-Type: 'application/json'
|
6
|
-
path: '/users/duffyduck/watchlist'
|
7
|
-
method: 'PUT'
|
8
|
-
body:
|
9
|
-
- m367
|
10
|
-
- m73
|
11
|
-
- m42
|
12
|
-
- m23
|
13
|
-
- s70
|
14
|
-
- s71
|
15
|
-
- s86
|
16
|
-
- s87
|
17
|
-
- s88
|
18
|
-
response_expectation:
|
19
|
-
status_code: 204
|
20
|
-
body:
|
21
|
-
- name: 'Check users watchlist afterwards'
|
22
|
-
request:
|
23
|
-
headers:
|
24
|
-
Content-Type: 'application/json'
|
25
|
-
path: '/users/duffyduck'
|
26
|
-
method: 'GET'
|
27
|
-
response_expectation:
|
28
|
-
status_code: 200
|
29
|
-
headers:
|
30
|
-
Last-Modified: /.*/
|
31
|
-
body:
|
32
|
-
username: 'duffyduck'
|
33
|
-
watchlist:
|
34
|
-
- m367
|
35
|
-
- m73
|
36
|
-
- m42
|
37
|
-
- m23
|
38
|
-
- s70
|
39
|
-
- s71
|
40
|
-
- s86
|
41
|
-
- s87
|
42
|
-
- s88
|
43
|
-
- name: 'Update existing user - clean watchlist'
|
44
|
-
request:
|
45
|
-
headers:
|
46
|
-
Content-Type: 'application/json'
|
47
|
-
path: '/users/duffyduck/watchlist'
|
48
|
-
method: 'PUT'
|
49
|
-
body: []
|
50
|
-
response_expectation:
|
51
|
-
status_code: 204
|
52
|
-
- name: 'Check users watchlist for emptyness afterwards'
|
53
|
-
request:
|
54
|
-
headers:
|
55
|
-
Content-Type: 'application/json'
|
56
|
-
path: '/users/duffyduck'
|
57
|
-
method: 'GET'
|
58
|
-
response_expectation:
|
59
|
-
status_code: 200
|
60
|
-
headers:
|
61
|
-
Last-Modified: /.*/
|
62
|
-
body:
|
63
|
-
username: 'duffyduck'
|
64
|
-
watchlist: []
|
65
|
-
- name: 'Update existing user - update skiplist'
|
66
|
-
request:
|
67
|
-
headers:
|
68
|
-
Content-Type: 'application/json'
|
69
|
-
path: '/users/duffyduck/skiplist'
|
70
|
-
method: 'PUT'
|
71
|
-
body:
|
72
|
-
- m366
|
73
|
-
- m72
|
74
|
-
- m41
|
75
|
-
- m22
|
76
|
-
- s101
|
77
|
-
- s100
|
78
|
-
- s99
|
79
|
-
- s69
|
80
|
-
- s70
|
81
|
-
response_expectation:
|
82
|
-
status_code: 204
|
83
|
-
body:
|
84
|
-
- name: 'Check users skiplist afterwards'
|
85
|
-
request:
|
86
|
-
headers:
|
87
|
-
Content-Type: 'application/json'
|
88
|
-
path: '/users/duffyduck'
|
89
|
-
method: 'GET'
|
90
|
-
response_expectation:
|
91
|
-
status_code: 200
|
92
|
-
headers:
|
93
|
-
Last-Modified: /.*/
|
94
|
-
body:
|
95
|
-
username: 'duffyduck'
|
96
|
-
skiplist:
|
97
|
-
- m366
|
98
|
-
- m72
|
99
|
-
- m41
|
100
|
-
- m22
|
101
|
-
- s101
|
102
|
-
- s100
|
103
|
-
- s99
|
104
|
-
- s69
|
105
|
-
- s70
|
106
|
-
- name: 'Update existing user - clean skiplist'
|
107
|
-
request:
|
108
|
-
headers:
|
109
|
-
Content-Type: 'application/json'
|
110
|
-
path: '/users/duffyduck/skiplist'
|
111
|
-
method: 'PUT'
|
112
|
-
body: []
|
113
|
-
response_expectation:
|
114
|
-
status_code: 204
|
115
|
-
body:
|
116
|
-
- name: 'Check users skiplist emptyness afterwards'
|
117
|
-
request:
|
118
|
-
headers:
|
119
|
-
Content-Type: 'application/json'
|
120
|
-
path: '/users/duffyduck'
|
121
|
-
method: 'GET'
|
122
|
-
response_expectation:
|
123
|
-
status_code: 200
|
124
|
-
headers:
|
125
|
-
Last-Modified: /.*/
|
126
|
-
body:
|
127
|
-
username: 'duffyduck'
|
128
|
-
skiplist: []
|
129
|
-
- name: 'Update existing user - update blacklist'
|
130
|
-
request:
|
131
|
-
headers:
|
132
|
-
Content-Type: 'application/json'
|
133
|
-
path: '/users/duffyduck/blacklist'
|
134
|
-
method: 'PUT'
|
135
|
-
body:
|
136
|
-
- m365
|
137
|
-
- m71
|
138
|
-
- m40
|
139
|
-
- m21
|
140
|
-
- s87
|
141
|
-
- s88
|
142
|
-
- s51
|
143
|
-
- s52
|
144
|
-
- s99
|
145
|
-
response_expectation:
|
146
|
-
status_code: 204
|
147
|
-
body:
|
148
|
-
- name: 'Check Users blacklist afterwards'
|
149
|
-
request:
|
150
|
-
headers:
|
151
|
-
Content-Type: 'application/json'
|
152
|
-
path: '/users/duffyduck'
|
153
|
-
method: 'GET'
|
154
|
-
response_expectation:
|
155
|
-
status_code: 200
|
156
|
-
headers:
|
157
|
-
Last-Modified: /.*/
|
158
|
-
body:
|
159
|
-
username: 'duffyduck'
|
160
|
-
blacklist:
|
161
|
-
- m365
|
162
|
-
- m71
|
163
|
-
- m40
|
164
|
-
- m21
|
165
|
-
- s87
|
166
|
-
- s88
|
167
|
-
- s51
|
168
|
-
- s52
|
169
|
-
- s99
|
170
|
-
- name: 'Update existing user - clean blacklist'
|
171
|
-
request:
|
172
|
-
headers:
|
173
|
-
Content-Type: 'application/json'
|
174
|
-
path: '/users/duffyduck/blacklist'
|
175
|
-
method: 'PUT'
|
176
|
-
body: []
|
177
|
-
response_expectation:
|
178
|
-
status_code: 204
|
179
|
-
body:
|
180
|
-
- name: 'Check users blacklist emptyness afterwards'
|
181
|
-
request:
|
182
|
-
headers:
|
183
|
-
Content-Type: 'application/json'
|
184
|
-
path: '/users/duffyduck'
|
185
|
-
method: 'GET'
|
186
|
-
response_expectation:
|
187
|
-
status_code: 200
|
188
|
-
headers:
|
189
|
-
Last-Modified: /.*/
|
190
|
-
body:
|
191
|
-
username: 'duffyduck'
|
192
|
-
blacklist: []
|
193
|
-
- name : 'Watchlist update of a non existing profile should return 404'
|
194
|
-
request:
|
195
|
-
headers:
|
196
|
-
Content-Type: 'application/json'
|
197
|
-
path: '/users/foobarfooz/watchlist'
|
198
|
-
method: 'PUT'
|
199
|
-
body:
|
200
|
-
watchlist:
|
201
|
-
- m365
|
202
|
-
- m71
|
203
|
-
- s70
|
204
|
-
- s88
|
205
|
-
response_expectation:
|
206
|
-
status_code: 404
|
207
|
-
- name : 'Skiplist update of a non existing profile should return 404'
|
208
|
-
request:
|
209
|
-
headers:
|
210
|
-
Content-Type: 'application/json'
|
211
|
-
path: '/users/foobarfooz/skiplist'
|
212
|
-
method: 'PUT'
|
213
|
-
body:
|
214
|
-
skiplist:
|
215
|
-
- m365
|
216
|
-
- m71
|
217
|
-
- s99
|
218
|
-
- s100
|
219
|
-
response_expectation:
|
220
|
-
status_code: 404
|
221
|
-
- name : 'Blacklist update of a non existing profile should return 404'
|
222
|
-
request:
|
223
|
-
headers:
|
224
|
-
Content-Type: 'application/json'
|
225
|
-
path: '/users/foobarfooz/blacklist'
|
226
|
-
method: 'PUT'
|
227
|
-
body:
|
228
|
-
blacklist:
|
229
|
-
- m365
|
230
|
-
- m71
|
231
|
-
- s71
|
232
|
-
- s70
|
233
|
-
response_expectation:
|
234
|
-
status_code: 404
|
235
|
-
- name : 'Watchlist update with non existing movies should return 409'
|
236
|
-
request:
|
237
|
-
headers:
|
238
|
-
Content-Type: 'application/json'
|
239
|
-
path: '/users/duffyduck/watchlist'
|
240
|
-
method: 'PUT'
|
241
|
-
body:
|
242
|
-
watchlist:
|
243
|
-
- m9999999999999999
|
244
|
-
- m8888888888888888
|
245
|
-
- m7777777777777777
|
246
|
-
response_expectation:
|
247
|
-
status_code: 409
|
248
|
-
- name : 'Watchlist update with non existing series should return 409'
|
249
|
-
request:
|
250
|
-
headers:
|
251
|
-
Content-Type: 'application/json'
|
252
|
-
path: '/users/duffyduck/watchlist'
|
253
|
-
method: 'PUT'
|
254
|
-
body:
|
255
|
-
watchlist:
|
256
|
-
- s9999999999999999
|
257
|
-
- s8888888888888888
|
258
|
-
- s7777777777777777
|
259
|
-
response_expectation:
|
260
|
-
status_code: 409
|
261
|
-
- name : 'Watchlist update with non existing movies AND series should return 409'
|
262
|
-
request:
|
263
|
-
headers:
|
264
|
-
Content-Type: 'application/json'
|
265
|
-
path: '/users/duffyduck/watchlist'
|
266
|
-
method: 'PUT'
|
267
|
-
body:
|
268
|
-
watchlist:
|
269
|
-
- m9999999999999999
|
270
|
-
- m8888888888888888
|
271
|
-
- m7777777777777777
|
272
|
-
- s9999999999999999
|
273
|
-
- s8888888888888888
|
274
|
-
- s7777777777777777
|
275
|
-
response_expectation:
|
276
|
-
status_code: 409
|
277
|
-
- name : 'Blacklist update with non existing movies should return 409'
|
278
|
-
request:
|
279
|
-
headers:
|
280
|
-
Content-Type: 'application/json'
|
281
|
-
path: '/users/duffyduck/blacklist'
|
282
|
-
method: 'PUT'
|
283
|
-
body:
|
284
|
-
blacklist:
|
285
|
-
- m9999999999999999
|
286
|
-
- m8888888888888888
|
287
|
-
- m7777777777777777
|
288
|
-
response_expectation:
|
289
|
-
status_code: 409
|
290
|
-
- name : 'Blacklist update with non existing series should return 409'
|
291
|
-
request:
|
292
|
-
headers:
|
293
|
-
Content-Type: 'application/json'
|
294
|
-
path: '/users/duffyduck/blacklist'
|
295
|
-
method: 'PUT'
|
296
|
-
body:
|
297
|
-
blacklist:
|
298
|
-
- s9999999999999999
|
299
|
-
- s8888888888888888
|
300
|
-
- s7777777777777777
|
301
|
-
response_expectation:
|
302
|
-
status_code: 409
|
303
|
-
- name : 'Blacklist update with non existing movies AND series should return 409'
|
304
|
-
request:
|
305
|
-
headers:
|
306
|
-
Content-Type: 'application/json'
|
307
|
-
path: '/users/duffyduck/blacklist'
|
308
|
-
method: 'PUT'
|
309
|
-
body:
|
310
|
-
blacklist:
|
311
|
-
- m9999999999999999
|
312
|
-
- m8888888888888888
|
313
|
-
- m7777777777777777
|
314
|
-
- s9999999999999999
|
315
|
-
- s8888888888888888
|
316
|
-
- s7777777777777777
|
317
|
-
response_expectation:
|
318
|
-
status_code: 409
|
319
|
-
- name : 'Skiplist update with non existing movies should return 409'
|
320
|
-
request:
|
321
|
-
headers:
|
322
|
-
Content-Type: 'application/json'
|
323
|
-
path: '/users/duffyduck/skiplist'
|
324
|
-
method: 'PUT'
|
325
|
-
body:
|
326
|
-
skiplist:
|
327
|
-
- m9999999999999999
|
328
|
-
- m8888888888888888
|
329
|
-
- m7777777777777777
|
330
|
-
response_expectation:
|
331
|
-
status_code: 409
|
332
|
-
- name : 'Skiplist update with non existing series should return 409'
|
333
|
-
request:
|
334
|
-
headers:
|
335
|
-
Content-Type: 'application/json'
|
336
|
-
path: '/users/duffyduck/skiplist'
|
337
|
-
method: 'PUT'
|
338
|
-
body:
|
339
|
-
skiplist:
|
340
|
-
- s9999999999999999
|
341
|
-
- s8888888888888888
|
342
|
-
- s7777777777777777
|
343
|
-
response_expectation:
|
344
|
-
status_code: 409
|
345
|
-
- name : 'Skiplist update with non existing movies AND series should return 409'
|
346
|
-
request:
|
347
|
-
headers:
|
348
|
-
Content-Type: 'application/json'
|
349
|
-
path: '/users/duffyduck/skiplist'
|
350
|
-
method: 'PUT'
|
351
|
-
body:
|
352
|
-
skiplist:
|
353
|
-
- m9999999999999999
|
354
|
-
- m8888888888888888
|
355
|
-
- m7777777777777777
|
356
|
-
- s9999999999999999
|
357
|
-
- s8888888888888888
|
358
|
-
- s7777777777777777
|
359
|
-
response_expectation:
|
360
|
-
status_code: 409
|
@@ -1,88 +0,0 @@
|
|
1
|
-
---
|
2
|
-
- name: "One putted movie rating should be createable with 204 response"
|
3
|
-
request:
|
4
|
-
headers:
|
5
|
-
Content-Type: 'application/json'
|
6
|
-
path: '/users/duffyduck/ratings'
|
7
|
-
method: 'PUT'
|
8
|
-
body:
|
9
|
-
m765: 1.0
|
10
|
-
response_expectation:
|
11
|
-
status_code: 204
|
12
|
-
body:
|
13
|
-
- name: "There should be exactly one movie rating in that profile"
|
14
|
-
request:
|
15
|
-
headers:
|
16
|
-
Content-Type: 'application/json'
|
17
|
-
path: '/users/duffyduck'
|
18
|
-
method: 'GET'
|
19
|
-
response_expectation:
|
20
|
-
status_code: 200
|
21
|
-
body:
|
22
|
-
ratings:
|
23
|
-
m765: 1.0
|
24
|
-
- name: "5 putted movie ratings should be createable with 204 response"
|
25
|
-
request:
|
26
|
-
headers:
|
27
|
-
Content-Type: 'application/json'
|
28
|
-
path: '/users/duffyduck/ratings'
|
29
|
-
method: 'PUT'
|
30
|
-
body:
|
31
|
-
m765: 1.0
|
32
|
-
m42: 2.0
|
33
|
-
m89: 3.0
|
34
|
-
m91: 4.0
|
35
|
-
m98: 5.0
|
36
|
-
response_expectation:
|
37
|
-
status_code: 204
|
38
|
-
body:
|
39
|
-
- name: "There should be exactly 5 movie ratings in that profile"
|
40
|
-
request:
|
41
|
-
headers:
|
42
|
-
Content-Type: 'application/json'
|
43
|
-
path: '/users/duffyduck'
|
44
|
-
method: 'GET'
|
45
|
-
response_expectation:
|
46
|
-
status_code: 200
|
47
|
-
body:
|
48
|
-
ratings:
|
49
|
-
m765: 1.0
|
50
|
-
m42: 2.0
|
51
|
-
m89: 3.0
|
52
|
-
m91: 4.0
|
53
|
-
m98: 5.0
|
54
|
-
- name: "It should return a 404 in case movie ratings for a non existant user are put"
|
55
|
-
request:
|
56
|
-
headers:
|
57
|
-
Content-Type: 'application/json'
|
58
|
-
path: '/users/daisyduck/ratings'
|
59
|
-
method: 'PUT'
|
60
|
-
body:
|
61
|
-
m765: 1.0
|
62
|
-
m42: 2.0
|
63
|
-
response_expectation:
|
64
|
-
status_code: 404
|
65
|
-
- name: "It should return a 409 in case movie ratings are put with ambigous moviemaster_id"
|
66
|
-
request:
|
67
|
-
headers:
|
68
|
-
Content-Type: 'application/json'
|
69
|
-
path: '/users/duffyduck/ratings'
|
70
|
-
method: 'PUT'
|
71
|
-
body:
|
72
|
-
m765000000000000: 1.0
|
73
|
-
m420000000000000: 2.0
|
74
|
-
response_expectation:
|
75
|
-
status_code: 409
|
76
|
-
body:
|
77
|
-
- name: "It should return a 409 in case movie ratings are put with ambigous ratings values"
|
78
|
-
request:
|
79
|
-
headers:
|
80
|
-
Content-Type: 'application/json'
|
81
|
-
path: '/users/duffyduck/ratings'
|
82
|
-
method: 'PUT'
|
83
|
-
body:
|
84
|
-
m765: 6.0
|
85
|
-
m42: -2.0
|
86
|
-
response_expectation:
|
87
|
-
status_code: 409
|
88
|
-
body:
|