trakt_api 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -6
- data/lib/trakt_api/activity.rb +11 -26
- data/lib/trakt_api/base.rb +5 -9
- data/lib/trakt_api/calendar.rb +2 -2
- data/lib/trakt_api/movie.rb +7 -7
- data/lib/trakt_api/movies.rb +2 -2
- data/lib/trakt_api/show.rb +12 -13
- data/lib/trakt_api/shows.rb +2 -2
- data/lib/trakt_api/user.rb +26 -34
- data/lib/trakt_api/version.rb +1 -1
- data/spec/trakt_api/activity_spec.rb +45 -99
- data/spec/trakt_api/base_spec.rb +4 -11
- data/spec/trakt_api/calendar_spec.rb +11 -11
- data/spec/trakt_api/movie_spec.rb +34 -22
- data/spec/trakt_api/movies_spec.rb +11 -5
- data/spec/trakt_api/show_spec.rb +63 -33
- data/spec/trakt_api/shows_spec.rb +11 -5
- data/spec/trakt_api/user_spec.rb +120 -192
- metadata +1 -1
@@ -5,15 +5,15 @@ describe TraktApi::Movies do
|
|
5
5
|
let(:mock_model) { SampleModel.new }
|
6
6
|
|
7
7
|
describe '.trending' do
|
8
|
-
it 'should call
|
9
|
-
model.
|
8
|
+
it 'should call get with specific params' do
|
9
|
+
model.instance_variable_set("@method", :get)
|
10
|
+
model.should_receive(:get).with('movies/trending').and_return(mock_model)
|
10
11
|
|
11
12
|
model.trending
|
12
13
|
end
|
13
14
|
|
14
|
-
it 'should call
|
15
|
-
model.
|
16
|
-
model.should_receive(:get).with('movies/trending').and_return(mock_model)
|
15
|
+
it 'should call params' do
|
16
|
+
model.should_receive(:params).and_return(mock_model)
|
17
17
|
|
18
18
|
model.trending
|
19
19
|
end
|
@@ -29,6 +29,12 @@ describe TraktApi::Movies do
|
|
29
29
|
model.updated(time: time)
|
30
30
|
end
|
31
31
|
|
32
|
+
it 'should call params' do
|
33
|
+
model.should_receive(:params).and_return(mock_model)
|
34
|
+
|
35
|
+
model.updated(time: time)
|
36
|
+
end
|
37
|
+
|
32
38
|
it 'should call restful_params' do
|
33
39
|
model.should_receive(:restful_params).and_return(mock_model)
|
34
40
|
|
data/spec/trakt_api/show_spec.rb
CHANGED
@@ -4,18 +4,18 @@ describe TraktApi::Show do
|
|
4
4
|
let(:model) { TraktApi::Show.new(TraktApi::Client.new) }
|
5
5
|
let(:mock_model) { SampleModel.new }
|
6
6
|
|
7
|
-
describe '.
|
7
|
+
describe '.cancel_check_in' do
|
8
8
|
it 'should call auth' do
|
9
9
|
model.should_receive(:auth).and_return(mock_model)
|
10
10
|
|
11
|
-
model.
|
11
|
+
model.cancel_check_in
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'should call post with specific params' do
|
15
15
|
model.instance_variable_set("@method", :post)
|
16
16
|
model.should_receive(:post).with('show/cancelcheckin').and_return(mock_model)
|
17
17
|
|
18
|
-
model.
|
18
|
+
model.cancel_check_in
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -63,6 +63,12 @@ describe TraktApi::Show do
|
|
63
63
|
model.comments
|
64
64
|
end
|
65
65
|
|
66
|
+
it 'should call params' do
|
67
|
+
model.should_receive(:params).and_return(mock_model)
|
68
|
+
|
69
|
+
model.comments
|
70
|
+
end
|
71
|
+
|
66
72
|
it 'should call restful_params' do
|
67
73
|
model.should_receive(:restful_params).and_return(mock_model)
|
68
74
|
|
@@ -78,6 +84,12 @@ describe TraktApi::Show do
|
|
78
84
|
model.episode_comments
|
79
85
|
end
|
80
86
|
|
87
|
+
it 'should call params' do
|
88
|
+
model.should_receive(:params).and_return(mock_model)
|
89
|
+
|
90
|
+
model.episode_comments
|
91
|
+
end
|
92
|
+
|
81
93
|
it 'should call restful_params' do
|
82
94
|
model.should_receive(:restful_params).and_return(mock_model)
|
83
95
|
|
@@ -135,6 +147,12 @@ describe TraktApi::Show do
|
|
135
147
|
model.episode_stats
|
136
148
|
end
|
137
149
|
|
150
|
+
it 'should call params' do
|
151
|
+
model.should_receive(:params).and_return(mock_model)
|
152
|
+
|
153
|
+
model.episode_stats
|
154
|
+
end
|
155
|
+
|
138
156
|
it 'should call restful_params' do
|
139
157
|
model.should_receive(:restful_params).and_return(mock_model)
|
140
158
|
|
@@ -143,15 +161,15 @@ describe TraktApi::Show do
|
|
143
161
|
end
|
144
162
|
|
145
163
|
describe '.episode_summary' do
|
146
|
-
it 'should call
|
147
|
-
model.
|
164
|
+
it 'should call get with specific params' do
|
165
|
+
model.instance_variable_set("@method", :get)
|
166
|
+
model.should_receive(:get).with('show/episode/summary').and_return(mock_model)
|
148
167
|
|
149
168
|
model.episode_summary
|
150
169
|
end
|
151
170
|
|
152
|
-
it 'should call
|
153
|
-
model.
|
154
|
-
model.should_receive(:get).with('show/episode/summary').and_return(mock_model)
|
171
|
+
it 'should call params' do
|
172
|
+
model.should_receive(:params).and_return(mock_model)
|
155
173
|
|
156
174
|
model.episode_summary
|
157
175
|
end
|
@@ -227,15 +245,15 @@ describe TraktApi::Show do
|
|
227
245
|
end
|
228
246
|
|
229
247
|
describe '.episode_watching_now' do
|
230
|
-
it 'should call
|
231
|
-
model.
|
248
|
+
it 'should call get with specific params' do
|
249
|
+
model.instance_variable_set("@method", :get)
|
250
|
+
model.should_receive(:get).with('show/episode/watchingnow').and_return(mock_model)
|
232
251
|
|
233
252
|
model.episode_watching_now
|
234
253
|
end
|
235
254
|
|
236
|
-
it 'should call
|
237
|
-
model.
|
238
|
-
model.should_receive(:get).with('show/episode/watchingnow').and_return(mock_model)
|
255
|
+
it 'should call params' do
|
256
|
+
model.should_receive(:params).and_return(mock_model)
|
239
257
|
|
240
258
|
model.episode_watching_now
|
241
259
|
end
|
@@ -290,15 +308,15 @@ describe TraktApi::Show do
|
|
290
308
|
end
|
291
309
|
|
292
310
|
describe '.related' do
|
293
|
-
it 'should call
|
294
|
-
model.
|
311
|
+
it 'should call get with specific params' do
|
312
|
+
model.instance_variable_set("@method", :get)
|
313
|
+
model.should_receive(:get).with('show/related').and_return(mock_model)
|
295
314
|
|
296
315
|
model.related
|
297
316
|
end
|
298
317
|
|
299
|
-
it 'should call
|
300
|
-
model.
|
301
|
-
model.should_receive(:get).with('show/related').and_return(mock_model)
|
318
|
+
it 'should call params' do
|
319
|
+
model.should_receive(:params).and_return(mock_model)
|
302
320
|
|
303
321
|
model.related
|
304
322
|
end
|
@@ -332,15 +350,15 @@ describe TraktApi::Show do
|
|
332
350
|
end
|
333
351
|
|
334
352
|
describe '.season' do
|
335
|
-
it 'should call
|
336
|
-
model.
|
353
|
+
it 'should call get with specific params' do
|
354
|
+
model.instance_variable_set("@method", :get)
|
355
|
+
model.should_receive(:get).with('show/season').and_return(mock_model)
|
337
356
|
|
338
357
|
model.season
|
339
358
|
end
|
340
359
|
|
341
|
-
it 'should call
|
342
|
-
model.
|
343
|
-
model.should_receive(:get).with('show/season').and_return(mock_model)
|
360
|
+
it 'should call params' do
|
361
|
+
model.should_receive(:params).and_return(mock_model)
|
344
362
|
|
345
363
|
model.season
|
346
364
|
end
|
@@ -402,6 +420,12 @@ describe TraktApi::Show do
|
|
402
420
|
model.seasons
|
403
421
|
end
|
404
422
|
|
423
|
+
it 'should call params' do
|
424
|
+
model.should_receive(:params).and_return(mock_model)
|
425
|
+
|
426
|
+
model.seasons
|
427
|
+
end
|
428
|
+
|
405
429
|
it 'should call restful_params' do
|
406
430
|
model.should_receive(:restful_params).and_return(mock_model)
|
407
431
|
|
@@ -438,6 +462,12 @@ describe TraktApi::Show do
|
|
438
462
|
model.stats
|
439
463
|
end
|
440
464
|
|
465
|
+
it 'should call params' do
|
466
|
+
model.should_receive(:params).and_return(mock_model)
|
467
|
+
|
468
|
+
model.stats
|
469
|
+
end
|
470
|
+
|
441
471
|
it 'should call restful_params' do
|
442
472
|
model.should_receive(:restful_params).and_return(mock_model)
|
443
473
|
|
@@ -446,15 +476,15 @@ describe TraktApi::Show do
|
|
446
476
|
end
|
447
477
|
|
448
478
|
describe '.summary' do
|
449
|
-
it 'should call
|
450
|
-
model.
|
479
|
+
it 'should call get with specific params' do
|
480
|
+
model.instance_variable_set("@method", :get)
|
481
|
+
model.should_receive(:get).with('show/summary').and_return(mock_model)
|
451
482
|
|
452
483
|
model.summary
|
453
484
|
end
|
454
485
|
|
455
|
-
it 'should call
|
456
|
-
model.
|
457
|
-
model.should_receive(:get).with('show/summary').and_return(mock_model)
|
486
|
+
it 'should call params' do
|
487
|
+
model.should_receive(:params).and_return(mock_model)
|
458
488
|
|
459
489
|
model.summary
|
460
490
|
end
|
@@ -545,15 +575,15 @@ describe TraktApi::Show do
|
|
545
575
|
end
|
546
576
|
|
547
577
|
describe '.watching_now' do
|
548
|
-
it 'should call
|
549
|
-
model.
|
578
|
+
it 'should call get with specific params' do
|
579
|
+
model.instance_variable_set("@method", :get)
|
580
|
+
model.should_receive(:get).with('show/watchingnow').and_return(mock_model)
|
550
581
|
|
551
582
|
model.watching_now
|
552
583
|
end
|
553
584
|
|
554
|
-
it 'should call
|
555
|
-
model.
|
556
|
-
model.should_receive(:get).with('show/watchingnow').and_return(mock_model)
|
585
|
+
it 'should call params' do
|
586
|
+
model.should_receive(:params).and_return(mock_model)
|
557
587
|
|
558
588
|
model.watching_now
|
559
589
|
end
|
@@ -5,15 +5,15 @@ describe TraktApi::Shows do
|
|
5
5
|
let(:mock_model) { SampleModel.new }
|
6
6
|
|
7
7
|
describe '.trending' do
|
8
|
-
it 'should call
|
9
|
-
model.
|
8
|
+
it 'should call get with specific params' do
|
9
|
+
model.instance_variable_set("@method", :get)
|
10
|
+
model.should_receive(:get).with('shows/trending').and_return(mock_model)
|
10
11
|
|
11
12
|
model.trending
|
12
13
|
end
|
13
14
|
|
14
|
-
it 'should call
|
15
|
-
model.
|
16
|
-
model.should_receive(:get).with('shows/trending').and_return(mock_model)
|
15
|
+
it 'should call params' do
|
16
|
+
model.should_receive(:params).and_return(mock_model)
|
17
17
|
|
18
18
|
model.trending
|
19
19
|
end
|
@@ -29,6 +29,12 @@ describe TraktApi::Shows do
|
|
29
29
|
model.updated(time: time)
|
30
30
|
end
|
31
31
|
|
32
|
+
it 'should call params' do
|
33
|
+
model.should_receive(:params).and_return(mock_model)
|
34
|
+
|
35
|
+
model.updated(time: time)
|
36
|
+
end
|
37
|
+
|
32
38
|
it 'should call restful_params' do
|
33
39
|
model.should_receive(:restful_params).and_return(mock_model)
|
34
40
|
|
data/spec/trakt_api/user_spec.rb
CHANGED
@@ -5,15 +5,15 @@ describe TraktApi::User do
|
|
5
5
|
let(:mock_model) { SampleModel.new }
|
6
6
|
|
7
7
|
describe '.calendar_shows' do
|
8
|
-
it 'should call
|
9
|
-
model.
|
8
|
+
it 'should call get with specific params' do
|
9
|
+
model.instance_variable_set("@method", :get)
|
10
|
+
model.should_receive(:get).with('user/calendar/shows').and_return(mock_model)
|
10
11
|
|
11
12
|
model.calendar_shows
|
12
13
|
end
|
13
14
|
|
14
|
-
it 'should call
|
15
|
-
model.
|
16
|
-
model.should_receive(:get).with('user/calendar/shows').and_return(mock_model)
|
15
|
+
it 'should call params' do
|
16
|
+
model.should_receive(:params).and_return(mock_model)
|
17
17
|
|
18
18
|
model.calendar_shows
|
19
19
|
end
|
@@ -26,15 +26,15 @@ describe TraktApi::User do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
describe '.last_activity' do
|
29
|
-
it 'should call
|
30
|
-
model.
|
29
|
+
it 'should call get with specific params' do
|
30
|
+
model.instance_variable_set("@method", :get)
|
31
|
+
model.should_receive(:get).with('user/lastactivity').and_return(mock_model)
|
31
32
|
|
32
33
|
model.last_activity
|
33
34
|
end
|
34
35
|
|
35
|
-
it 'should call
|
36
|
-
model.
|
37
|
-
model.should_receive(:get).with('user/lastactivity').and_return(mock_model)
|
36
|
+
it 'should call params' do
|
37
|
+
model.should_receive(:params).and_return(mock_model)
|
38
38
|
|
39
39
|
model.last_activity
|
40
40
|
end
|
@@ -47,12 +47,6 @@ describe TraktApi::User do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
describe '.library_movies_all' do
|
50
|
-
it 'should call optional_auth' do
|
51
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
52
|
-
|
53
|
-
model.library_movies_all
|
54
|
-
end
|
55
|
-
|
56
50
|
it 'should call get with specific params' do
|
57
51
|
model.instance_variable_set("@method", :get)
|
58
52
|
model.should_receive(:get).with('user/library/movies/all').and_return(mock_model)
|
@@ -60,26 +54,20 @@ describe TraktApi::User do
|
|
60
54
|
model.library_movies_all
|
61
55
|
end
|
62
56
|
|
63
|
-
it 'should call
|
64
|
-
model.should_receive(:
|
57
|
+
it 'should call params' do
|
58
|
+
model.should_receive(:params).and_return(mock_model)
|
65
59
|
|
66
60
|
model.library_movies_all
|
67
61
|
end
|
68
62
|
|
69
|
-
it 'should call
|
70
|
-
model.should_receive(:
|
63
|
+
it 'should call restful_params' do
|
64
|
+
model.should_receive(:restful_params).and_return(mock_model)
|
71
65
|
|
72
66
|
model.library_movies_all
|
73
67
|
end
|
74
68
|
end
|
75
69
|
|
76
70
|
describe '.library_movies_collection' do
|
77
|
-
it 'should call optional_auth' do
|
78
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
79
|
-
|
80
|
-
model.library_movies_collection
|
81
|
-
end
|
82
|
-
|
83
71
|
it 'should call get with specific params' do
|
84
72
|
model.instance_variable_set("@method", :get)
|
85
73
|
model.should_receive(:get).with('user/library/movies/collection').and_return(mock_model)
|
@@ -87,26 +75,20 @@ describe TraktApi::User do
|
|
87
75
|
model.library_movies_collection
|
88
76
|
end
|
89
77
|
|
90
|
-
it 'should call restful_params' do
|
91
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
92
|
-
|
93
|
-
model.library_movies_all
|
94
|
-
end
|
95
|
-
|
96
78
|
it 'should call params' do
|
97
79
|
model.should_receive(:params).and_return(mock_model)
|
98
80
|
|
99
81
|
model.library_movies_collection
|
100
82
|
end
|
101
|
-
end
|
102
83
|
|
103
|
-
|
104
|
-
|
105
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
84
|
+
it 'should call restful_params' do
|
85
|
+
model.should_receive(:restful_params).and_return(mock_model)
|
106
86
|
|
107
|
-
model.
|
87
|
+
model.library_movies_all
|
108
88
|
end
|
89
|
+
end
|
109
90
|
|
91
|
+
describe '.library_movies_watched' do
|
110
92
|
it 'should call get with specific params' do
|
111
93
|
model.instance_variable_set("@method", :get)
|
112
94
|
model.should_receive(:get).with('user/library/movies/watched').and_return(mock_model)
|
@@ -114,26 +96,20 @@ describe TraktApi::User do
|
|
114
96
|
model.library_movies_watched
|
115
97
|
end
|
116
98
|
|
117
|
-
it 'should call restful_params' do
|
118
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
119
|
-
|
120
|
-
model.library_movies_all
|
121
|
-
end
|
122
|
-
|
123
99
|
it 'should call params' do
|
124
100
|
model.should_receive(:params).and_return(mock_model)
|
125
101
|
|
126
102
|
model.library_movies_watched
|
127
103
|
end
|
128
|
-
end
|
129
104
|
|
130
|
-
|
131
|
-
|
132
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
105
|
+
it 'should call restful_params' do
|
106
|
+
model.should_receive(:restful_params).and_return(mock_model)
|
133
107
|
|
134
|
-
model.
|
108
|
+
model.library_movies_all
|
135
109
|
end
|
110
|
+
end
|
136
111
|
|
112
|
+
describe '.library_shows_all' do
|
137
113
|
it 'should call get with specific params' do
|
138
114
|
model.instance_variable_set("@method", :get)
|
139
115
|
model.should_receive(:get).with('user/library/shows/all').and_return(mock_model)
|
@@ -141,26 +117,20 @@ describe TraktApi::User do
|
|
141
117
|
model.library_shows_all
|
142
118
|
end
|
143
119
|
|
144
|
-
it 'should call restful_params' do
|
145
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
146
|
-
|
147
|
-
model.library_movies_all
|
148
|
-
end
|
149
|
-
|
150
120
|
it 'should call params' do
|
151
121
|
model.should_receive(:params).and_return(mock_model)
|
152
122
|
|
153
123
|
model.library_shows_all
|
154
124
|
end
|
155
|
-
end
|
156
125
|
|
157
|
-
|
158
|
-
|
159
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
126
|
+
it 'should call restful_params' do
|
127
|
+
model.should_receive(:restful_params).and_return(mock_model)
|
160
128
|
|
161
|
-
model.
|
129
|
+
model.library_movies_all
|
162
130
|
end
|
131
|
+
end
|
163
132
|
|
133
|
+
describe '.library_shows_collection' do
|
164
134
|
it 'should call get with specific params' do
|
165
135
|
model.instance_variable_set("@method", :get)
|
166
136
|
model.should_receive(:get).with('user/library/shows/collection').and_return(mock_model)
|
@@ -168,26 +138,20 @@ describe TraktApi::User do
|
|
168
138
|
model.library_shows_collection
|
169
139
|
end
|
170
140
|
|
171
|
-
it 'should call restful_params' do
|
172
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
173
|
-
|
174
|
-
model.library_movies_collection
|
175
|
-
end
|
176
|
-
|
177
141
|
it 'should call params' do
|
178
142
|
model.should_receive(:params).and_return(mock_model)
|
179
143
|
|
180
144
|
model.library_shows_collection
|
181
145
|
end
|
182
|
-
end
|
183
146
|
|
184
|
-
|
185
|
-
|
186
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
147
|
+
it 'should call restful_params' do
|
148
|
+
model.should_receive(:restful_params).and_return(mock_model)
|
187
149
|
|
188
|
-
model.
|
150
|
+
model.library_movies_collection
|
189
151
|
end
|
152
|
+
end
|
190
153
|
|
154
|
+
describe '.library_shows_watched' do
|
191
155
|
it 'should call get with specific params' do
|
192
156
|
model.instance_variable_set("@method", :get)
|
193
157
|
model.should_receive(:get).with('user/library/shows/watched').and_return(mock_model)
|
@@ -195,26 +159,20 @@ describe TraktApi::User do
|
|
195
159
|
model.library_shows_watched
|
196
160
|
end
|
197
161
|
|
198
|
-
it 'should call restful_params' do
|
199
|
-
model.should_receive(:restful_params).and_return(mock_model)
|
200
|
-
|
201
|
-
model.library_movies_watched
|
202
|
-
end
|
203
|
-
|
204
162
|
it 'should call params' do
|
205
163
|
model.should_receive(:params).and_return(mock_model)
|
206
164
|
|
207
165
|
model.library_shows_watched
|
208
166
|
end
|
209
|
-
end
|
210
167
|
|
211
|
-
|
212
|
-
|
213
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
168
|
+
it 'should call restful_params' do
|
169
|
+
model.should_receive(:restful_params).and_return(mock_model)
|
214
170
|
|
215
|
-
model.
|
171
|
+
model.library_movies_watched
|
216
172
|
end
|
173
|
+
end
|
217
174
|
|
175
|
+
describe '.list' do
|
218
176
|
it 'should call get with specific params' do
|
219
177
|
model.instance_variable_set("@method", :get)
|
220
178
|
model.should_receive(:get).with('user/list').and_return(mock_model)
|
@@ -222,26 +180,20 @@ describe TraktApi::User do
|
|
222
180
|
model.list
|
223
181
|
end
|
224
182
|
|
225
|
-
it 'should call
|
226
|
-
model.should_receive(:
|
183
|
+
it 'should call params' do
|
184
|
+
model.should_receive(:params).and_return(mock_model)
|
227
185
|
|
228
186
|
model.list
|
229
187
|
end
|
230
188
|
|
231
|
-
it 'should call
|
232
|
-
model.should_receive(:
|
189
|
+
it 'should call restful_params' do
|
190
|
+
model.should_receive(:restful_params).and_return(mock_model)
|
233
191
|
|
234
192
|
model.list
|
235
193
|
end
|
236
194
|
end
|
237
195
|
|
238
196
|
describe '.lists' do
|
239
|
-
it 'should call optional_auth' do
|
240
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
241
|
-
|
242
|
-
model.lists
|
243
|
-
end
|
244
|
-
|
245
197
|
it 'should call get with specific params' do
|
246
198
|
model.instance_variable_set("@method", :get)
|
247
199
|
model.should_receive(:get).with('user/lists').and_return(mock_model)
|
@@ -249,26 +201,20 @@ describe TraktApi::User do
|
|
249
201
|
model.lists
|
250
202
|
end
|
251
203
|
|
252
|
-
it 'should call
|
253
|
-
model.should_receive(:
|
204
|
+
it 'should call params' do
|
205
|
+
model.should_receive(:params).and_return(mock_model)
|
254
206
|
|
255
207
|
model.lists
|
256
208
|
end
|
257
209
|
|
258
|
-
it 'should call
|
259
|
-
model.should_receive(:
|
210
|
+
it 'should call restful_params' do
|
211
|
+
model.should_receive(:restful_params).and_return(mock_model)
|
260
212
|
|
261
213
|
model.lists
|
262
214
|
end
|
263
215
|
end
|
264
216
|
|
265
217
|
describe '.network_followers' do
|
266
|
-
it 'should call optional_auth' do
|
267
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
268
|
-
|
269
|
-
model.network_followers
|
270
|
-
end
|
271
|
-
|
272
218
|
it 'should call get with specific params' do
|
273
219
|
model.instance_variable_set("@method", :get)
|
274
220
|
model.should_receive(:get).with('user/network/followers').and_return(mock_model)
|
@@ -276,26 +222,20 @@ describe TraktApi::User do
|
|
276
222
|
model.network_followers
|
277
223
|
end
|
278
224
|
|
279
|
-
it 'should call
|
280
|
-
model.should_receive(:
|
225
|
+
it 'should call params' do
|
226
|
+
model.should_receive(:params).and_return(mock_model)
|
281
227
|
|
282
228
|
model.network_followers
|
283
229
|
end
|
284
230
|
|
285
|
-
it 'should call
|
286
|
-
model.should_receive(:
|
231
|
+
it 'should call restful_params' do
|
232
|
+
model.should_receive(:restful_params).and_return(mock_model)
|
287
233
|
|
288
234
|
model.network_followers
|
289
235
|
end
|
290
236
|
end
|
291
237
|
|
292
238
|
describe '.network_following' do
|
293
|
-
it 'should call optional_auth' do
|
294
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
295
|
-
|
296
|
-
model.network_following
|
297
|
-
end
|
298
|
-
|
299
239
|
it 'should call get with specific params' do
|
300
240
|
model.instance_variable_set("@method", :get)
|
301
241
|
model.should_receive(:get).with('user/network/following').and_return(mock_model)
|
@@ -303,26 +243,20 @@ describe TraktApi::User do
|
|
303
243
|
model.network_following
|
304
244
|
end
|
305
245
|
|
306
|
-
it 'should call
|
307
|
-
model.should_receive(:
|
246
|
+
it 'should call params' do
|
247
|
+
model.should_receive(:params).and_return(mock_model)
|
308
248
|
|
309
249
|
model.network_following
|
310
250
|
end
|
311
251
|
|
312
|
-
it 'should call
|
313
|
-
model.should_receive(:
|
252
|
+
it 'should call restful_params' do
|
253
|
+
model.should_receive(:restful_params).and_return(mock_model)
|
314
254
|
|
315
255
|
model.network_following
|
316
256
|
end
|
317
257
|
end
|
318
258
|
|
319
259
|
describe '.network_friends' do
|
320
|
-
it 'should call optional_auth' do
|
321
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
322
|
-
|
323
|
-
model.network_friends
|
324
|
-
end
|
325
|
-
|
326
260
|
it 'should call get with specific params' do
|
327
261
|
model.instance_variable_set("@method", :get)
|
328
262
|
model.should_receive(:get).with('user/network/friends').and_return(mock_model)
|
@@ -330,26 +264,20 @@ describe TraktApi::User do
|
|
330
264
|
model.network_friends
|
331
265
|
end
|
332
266
|
|
333
|
-
it 'should call
|
334
|
-
model.should_receive(:
|
267
|
+
it 'should call params' do
|
268
|
+
model.should_receive(:params).and_return(mock_model)
|
335
269
|
|
336
270
|
model.network_friends
|
337
271
|
end
|
338
272
|
|
339
|
-
it 'should call
|
340
|
-
model.should_receive(:
|
273
|
+
it 'should call restful_params' do
|
274
|
+
model.should_receive(:restful_params).and_return(mock_model)
|
341
275
|
|
342
276
|
model.network_friends
|
343
277
|
end
|
344
278
|
end
|
345
279
|
|
346
280
|
describe '.profile' do
|
347
|
-
it 'should call optional_auth' do
|
348
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
349
|
-
|
350
|
-
model.profile
|
351
|
-
end
|
352
|
-
|
353
281
|
it 'should call get with specific params' do
|
354
282
|
model.instance_variable_set("@method", :get)
|
355
283
|
model.should_receive(:get).with('user/profile').and_return(mock_model)
|
@@ -357,29 +285,29 @@ describe TraktApi::User do
|
|
357
285
|
model.profile
|
358
286
|
end
|
359
287
|
|
360
|
-
it 'should call
|
361
|
-
model.should_receive(:
|
288
|
+
it 'should call params' do
|
289
|
+
model.should_receive(:params).and_return(mock_model)
|
362
290
|
|
363
291
|
model.profile
|
364
292
|
end
|
365
293
|
|
366
|
-
it 'should call
|
367
|
-
model.should_receive(:
|
294
|
+
it 'should call restful_params' do
|
295
|
+
model.should_receive(:restful_params).and_return(mock_model)
|
368
296
|
|
369
297
|
model.profile
|
370
298
|
end
|
371
299
|
end
|
372
300
|
|
373
301
|
describe '.progress_collected' do
|
374
|
-
it 'should call
|
375
|
-
model.
|
302
|
+
it 'should call get with specific params' do
|
303
|
+
model.instance_variable_set("@method", :get)
|
304
|
+
model.should_receive(:get).with('user/progress/collected').and_return(mock_model)
|
376
305
|
|
377
306
|
model.progress_collected
|
378
307
|
end
|
379
308
|
|
380
|
-
it 'should call
|
381
|
-
model.
|
382
|
-
model.should_receive(:get).with('user/progress/collected').and_return(mock_model)
|
309
|
+
it 'should call params' do
|
310
|
+
model.should_receive(:params).and_return(mock_model)
|
383
311
|
|
384
312
|
model.progress_collected
|
385
313
|
end
|
@@ -392,15 +320,15 @@ describe TraktApi::User do
|
|
392
320
|
end
|
393
321
|
|
394
322
|
describe '.progress_watched' do
|
395
|
-
it 'should call
|
396
|
-
model.
|
323
|
+
it 'should call get with specific params' do
|
324
|
+
model.instance_variable_set("@method", :get)
|
325
|
+
model.should_receive(:get).with('user/progress/watched').and_return(mock_model)
|
397
326
|
|
398
327
|
model.progress_watched
|
399
328
|
end
|
400
329
|
|
401
|
-
it 'should call
|
402
|
-
model.
|
403
|
-
model.should_receive(:get).with('user/progress/watched').and_return(mock_model)
|
330
|
+
it 'should call params' do
|
331
|
+
model.should_receive(:params).and_return(mock_model)
|
404
332
|
|
405
333
|
model.progress_watched
|
406
334
|
end
|
@@ -413,15 +341,15 @@ describe TraktApi::User do
|
|
413
341
|
end
|
414
342
|
|
415
343
|
describe '.ratings_episodes' do
|
416
|
-
it 'should call
|
417
|
-
model.
|
344
|
+
it 'should call get with specific params' do
|
345
|
+
model.instance_variable_set("@method", :get)
|
346
|
+
model.should_receive(:get).with('user/ratings/episodes').and_return(mock_model)
|
418
347
|
|
419
348
|
model.ratings_episodes
|
420
349
|
end
|
421
350
|
|
422
|
-
it 'should call
|
423
|
-
model.
|
424
|
-
model.should_receive(:get).with('user/ratings/episodes').and_return(mock_model)
|
351
|
+
it 'should call params' do
|
352
|
+
model.should_receive(:params).and_return(mock_model)
|
425
353
|
|
426
354
|
model.ratings_episodes
|
427
355
|
end
|
@@ -434,15 +362,15 @@ describe TraktApi::User do
|
|
434
362
|
end
|
435
363
|
|
436
364
|
describe '.ratings_movies' do
|
437
|
-
it 'should call
|
438
|
-
model.
|
365
|
+
it 'should call get with specific params' do
|
366
|
+
model.instance_variable_set("@method", :get)
|
367
|
+
model.should_receive(:get).with('user/ratings/movies').and_return(mock_model)
|
439
368
|
|
440
369
|
model.ratings_movies
|
441
370
|
end
|
442
371
|
|
443
|
-
it 'should call
|
444
|
-
model.
|
445
|
-
model.should_receive(:get).with('user/ratings/movies').and_return(mock_model)
|
372
|
+
it 'should call params' do
|
373
|
+
model.should_receive(:params).and_return(mock_model)
|
446
374
|
|
447
375
|
model.ratings_movies
|
448
376
|
end
|
@@ -455,15 +383,15 @@ describe TraktApi::User do
|
|
455
383
|
end
|
456
384
|
|
457
385
|
describe '.ratings_shows' do
|
458
|
-
it 'should call
|
459
|
-
model.
|
386
|
+
it 'should call get with specific params' do
|
387
|
+
model.instance_variable_set("@method", :get)
|
388
|
+
model.should_receive(:get).with('user/ratings/shows').and_return(mock_model)
|
460
389
|
|
461
390
|
model.ratings_shows
|
462
391
|
end
|
463
392
|
|
464
|
-
it 'should call
|
465
|
-
model.
|
466
|
-
model.should_receive(:get).with('user/ratings/shows').and_return(mock_model)
|
393
|
+
it 'should call params' do
|
394
|
+
model.should_receive(:params).and_return(mock_model)
|
467
395
|
|
468
396
|
model.ratings_shows
|
469
397
|
end
|
@@ -476,15 +404,15 @@ describe TraktApi::User do
|
|
476
404
|
end
|
477
405
|
|
478
406
|
describe '.watching' do
|
479
|
-
it 'should call
|
480
|
-
model.
|
407
|
+
it 'should call get with specific params' do
|
408
|
+
model.instance_variable_set("@method", :get)
|
409
|
+
model.should_receive(:get).with('user/watching').and_return(mock_model)
|
481
410
|
|
482
411
|
model.watching
|
483
412
|
end
|
484
413
|
|
485
|
-
it 'should call
|
486
|
-
model.
|
487
|
-
model.should_receive(:get).with('user/watching').and_return(mock_model)
|
414
|
+
it 'should call params' do
|
415
|
+
model.should_receive(:params).and_return(mock_model)
|
488
416
|
|
489
417
|
model.watching
|
490
418
|
end
|
@@ -496,66 +424,66 @@ describe TraktApi::User do
|
|
496
424
|
end
|
497
425
|
end
|
498
426
|
|
499
|
-
describe '.
|
500
|
-
it 'should call optional_auth' do
|
501
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
502
|
-
|
503
|
-
model.watchlist_episode
|
504
|
-
end
|
505
|
-
|
427
|
+
describe '.watch_list_episode' do
|
506
428
|
it 'should call get with specific params' do
|
507
429
|
model.instance_variable_set("@method", :get)
|
508
430
|
model.should_receive(:get).with('user/watchlist/episodes').and_return(mock_model)
|
509
431
|
|
510
|
-
model.
|
432
|
+
model.watch_list_episode
|
511
433
|
end
|
512
434
|
|
513
|
-
it 'should call
|
514
|
-
model.should_receive(:
|
435
|
+
it 'should call params' do
|
436
|
+
model.should_receive(:params).and_return(mock_model)
|
515
437
|
|
516
|
-
model.
|
438
|
+
model.watch_list_episode
|
517
439
|
end
|
518
|
-
end
|
519
440
|
|
520
|
-
|
521
|
-
|
522
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
441
|
+
it 'should call restful_params' do
|
442
|
+
model.should_receive(:restful_params).and_return(mock_model)
|
523
443
|
|
524
|
-
model.
|
444
|
+
model.watch_list_episode
|
525
445
|
end
|
446
|
+
end
|
526
447
|
|
448
|
+
describe '.watch_list_movies' do
|
527
449
|
it 'should call get with specific params' do
|
528
450
|
model.instance_variable_set("@method", :get)
|
529
451
|
model.should_receive(:get).with('user/watchlist/movies').and_return(mock_model)
|
530
452
|
|
531
|
-
model.
|
453
|
+
model.watch_list_movies
|
532
454
|
end
|
533
455
|
|
534
|
-
it 'should call
|
535
|
-
model.should_receive(:
|
456
|
+
it 'should call params' do
|
457
|
+
model.should_receive(:params).and_return(mock_model)
|
536
458
|
|
537
|
-
model.
|
459
|
+
model.watch_list_movies
|
538
460
|
end
|
539
|
-
end
|
540
461
|
|
541
|
-
|
542
|
-
|
543
|
-
model.should_receive(:optional_auth).and_return(mock_model)
|
462
|
+
it 'should call restful_params' do
|
463
|
+
model.should_receive(:restful_params).and_return(mock_model)
|
544
464
|
|
545
|
-
model.
|
465
|
+
model.watch_list_movies
|
546
466
|
end
|
467
|
+
end
|
547
468
|
|
469
|
+
describe '.watch_list_shows' do
|
548
470
|
it 'should call get with specific params' do
|
549
471
|
model.instance_variable_set("@method", :get)
|
550
472
|
model.should_receive(:get).with('user/watchlist/shows').and_return(mock_model)
|
551
473
|
|
552
|
-
model.
|
474
|
+
model.watch_list_shows
|
475
|
+
end
|
476
|
+
|
477
|
+
it 'should call params' do
|
478
|
+
model.should_receive(:params).and_return(mock_model)
|
479
|
+
|
480
|
+
model.watch_list_shows
|
553
481
|
end
|
554
482
|
|
555
483
|
it 'should call restful_params' do
|
556
484
|
model.should_receive(:restful_params).and_return(mock_model)
|
557
485
|
|
558
|
-
model.
|
486
|
+
model.watch_list_shows
|
559
487
|
end
|
560
488
|
end
|
561
489
|
end
|