themoviedb 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +10 -5
- data/lib/themoviedb/api.rb +5 -5
- data/lib/themoviedb/collection.rb +1 -1
- data/lib/themoviedb/company.rb +1 -1
- data/lib/themoviedb/configuration.rb +8 -8
- data/lib/themoviedb/episode.rb +3 -3
- data/lib/themoviedb/find.rb +6 -6
- data/lib/themoviedb/genre.rb +5 -5
- data/lib/themoviedb/job.rb +1 -1
- data/lib/themoviedb/keyword.rb +20 -0
- data/lib/themoviedb/movie.rb +15 -9
- data/lib/themoviedb/person.rb +3 -3
- data/lib/themoviedb/resource.rb +1 -1
- data/lib/themoviedb/search.rb +22 -20
- data/lib/themoviedb/season.rb +3 -3
- data/lib/themoviedb/tv.rb +6 -6
- data/lib/themoviedb/version.rb +2 -1
- data/lib/themoviedb.rb +6 -6
- data/spec/company_spec.rb +30 -32
- data/spec/find_spec.rb +14 -16
- data/spec/invalid_api_key_spec.rb +13 -14
- data/spec/keyword_spec.rb +66 -0
- data/spec/movie_spec.rb +134 -133
- data/spec/person_spec.rb +60 -63
- data/spec/spec_helper.rb +13 -17
- data/spec/tv_spec.rb +175 -177
- data/spec/vcr/keyword/detail.yml +56 -0
- data/spec/vcr/keyword/movies_for_id.yml +334 -0
- data/spec/vcr/movie/detail.yml +22 -56
- data/themoviedb.gemspec +1 -7
- metadata +50 -100
data/spec/tv_spec.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
require
|
2
|
-
require 'spec_helper'
|
3
|
-
require 'vcr'
|
1
|
+
require "spec_helper"
|
4
2
|
|
5
|
-
describe Tmdb::TV do
|
3
|
+
RSpec.describe Tmdb::TV do
|
6
4
|
@fields = [
|
7
5
|
:backdrop_path,
|
8
6
|
:created_by,
|
@@ -35,403 +33,403 @@ describe Tmdb::TV do
|
|
35
33
|
it { should respond_to field }
|
36
34
|
end
|
37
35
|
|
38
|
-
describe
|
36
|
+
describe "For Chuck it should return images" do
|
39
37
|
before(:each) do
|
40
|
-
VCR.use_cassette
|
38
|
+
VCR.use_cassette "tv/test_chuck" do
|
41
39
|
@tv = Tmdb::TV.images(1404)
|
42
40
|
end
|
43
41
|
end
|
44
42
|
|
45
|
-
it
|
46
|
-
expect(@tv[
|
43
|
+
it "should return backdrops for chuck" do
|
44
|
+
expect(@tv["backdrops"].length).to be >= 1
|
47
45
|
end
|
48
46
|
|
49
|
-
it
|
50
|
-
expect(@tv[
|
47
|
+
it "should return posters for chuck" do
|
48
|
+
expect(@tv["posters"].length).to be >= 1
|
51
49
|
end
|
52
50
|
end
|
53
51
|
|
54
|
-
describe
|
52
|
+
describe "For a TV detail" do
|
55
53
|
before(:each) do
|
56
|
-
VCR.use_cassette
|
54
|
+
VCR.use_cassette "tv/detail" do
|
57
55
|
@tv = Tmdb::TV.detail(1396)
|
58
56
|
end
|
59
57
|
end
|
60
58
|
|
61
|
-
it
|
62
|
-
expect(@tv[
|
59
|
+
it "should return a id" do
|
60
|
+
expect(@tv["id"]).to eq 1396
|
63
61
|
end
|
64
62
|
|
65
|
-
it
|
66
|
-
expect(@tv[
|
63
|
+
it "should return a backdrop" do
|
64
|
+
expect(@tv["backdrop_path"]).to eq "/8STVFl9kvWtFAydXUFHIUvT47AA.jpg"
|
67
65
|
end
|
68
66
|
|
69
|
-
it
|
70
|
-
expect(@tv[
|
67
|
+
it "should return a created date" do
|
68
|
+
expect(@tv["created_by"].first["name"]).to eq "Vince Gilligan"
|
71
69
|
end
|
72
70
|
|
73
|
-
it
|
74
|
-
expect(@tv[
|
71
|
+
it "should return a run time" do
|
72
|
+
expect(@tv["episode_run_time"]).to eq [45, 47]
|
75
73
|
end
|
76
74
|
|
77
|
-
it
|
78
|
-
expect(@tv[
|
75
|
+
it "should return genres" do
|
76
|
+
expect(@tv["genres"]).not_to eq []
|
79
77
|
end
|
80
78
|
|
81
|
-
it
|
82
|
-
expect(@tv[
|
79
|
+
it "should return a first air date" do
|
80
|
+
expect(@tv["first_air_date"]).to eq "2008-01-20"
|
83
81
|
end
|
84
82
|
|
85
|
-
it
|
86
|
-
expect(@tv[
|
83
|
+
it "should return a homepage" do
|
84
|
+
expect(@tv["homepage"]).to eq "http://www.amctv.com/shows/breaking-bad"
|
87
85
|
end
|
88
86
|
|
89
|
-
it
|
90
|
-
expect(@tv[
|
87
|
+
it "should return a production state" do
|
88
|
+
expect(@tv["in_production"]).to be_falsey
|
91
89
|
end
|
92
90
|
|
93
|
-
it
|
94
|
-
expect(@tv[
|
91
|
+
it "should return languages" do
|
92
|
+
expect(@tv["languages"]).to eq %w[en de ro es fa]
|
95
93
|
end
|
96
94
|
|
97
|
-
it
|
98
|
-
expect(@tv[
|
95
|
+
it "should return a last air date" do
|
96
|
+
expect(@tv["last_air_date"]).to eq "2013-09-29"
|
99
97
|
end
|
100
98
|
|
101
|
-
it
|
102
|
-
expect(@tv[
|
99
|
+
it "should return a name" do
|
100
|
+
expect(@tv["name"]).to eq "Breaking Bad"
|
103
101
|
end
|
104
102
|
|
105
|
-
it
|
106
|
-
expect(@tv[
|
107
|
-
@tv[
|
103
|
+
it "should return a network" do
|
104
|
+
expect(@tv["networks"].first["id"]).to eq 174
|
105
|
+
@tv["networks"].first["name"] == "AMC"
|
108
106
|
end
|
109
107
|
|
110
|
-
it
|
111
|
-
expect(@tv[
|
108
|
+
it "should return the number of episodes" do
|
109
|
+
expect(@tv["number_of_episodes"]).to eq 62
|
112
110
|
end
|
113
111
|
|
114
|
-
it
|
115
|
-
expect(@tv[
|
112
|
+
it "should return the number of seasons" do
|
113
|
+
expect(@tv["number_of_seasons"]).to eq 5
|
116
114
|
end
|
117
115
|
|
118
|
-
it
|
119
|
-
expect(@tv[
|
116
|
+
it "should return the original name" do
|
117
|
+
expect(@tv["original_name"]).to eq "Breaking Bad"
|
120
118
|
end
|
121
119
|
|
122
|
-
it
|
123
|
-
expect(@tv[
|
120
|
+
it "should return the origin country" do
|
121
|
+
expect(@tv["origin_country"]).to eq ["US"]
|
124
122
|
end
|
125
123
|
|
126
|
-
it
|
127
|
-
expect(@tv[
|
124
|
+
it "should return a overview" do
|
125
|
+
expect(@tv["overview"]).to eq "Breaking Bad is an American crime drama television series created and produced by Vince Gilligan. Set and produced in Albuquerque, New Mexico, Breaking Bad is the story of Walter White, a struggling high school chemistry teacher who is diagnosed with inoperable lung cancer at the beginning of the series. He turns to a life of crime, producing and selling methamphetamine, in order to secure his family's financial future before he dies, teaming with his former student, Jesse Pinkman. Heavily serialized, the series is known for positioning its characters in seemingly inextricable corners and has been labeled a contemporary western by its creator."
|
128
126
|
end
|
129
127
|
|
130
|
-
it
|
131
|
-
expect(@tv[
|
128
|
+
it "should return a popularity rating" do
|
129
|
+
expect(@tv["popularity"]).to eq 6.60821276854239
|
132
130
|
end
|
133
131
|
|
134
|
-
it
|
135
|
-
expect(@tv[
|
132
|
+
it "should return a poster" do
|
133
|
+
expect(@tv["poster_path"]).to eq "/iRDNn9EHKuBhGa77UBteazvsZa1.jpg"
|
136
134
|
end
|
137
135
|
|
138
|
-
it
|
139
|
-
expect(@tv[
|
136
|
+
it "should return seasons" do
|
137
|
+
expect(@tv["seasons"]).not_to eq []
|
140
138
|
end
|
141
139
|
|
142
|
-
it
|
143
|
-
expect(@tv[
|
140
|
+
it "should return a status" do
|
141
|
+
expect(@tv["status"]).to eq "Ended"
|
144
142
|
end
|
145
143
|
|
146
|
-
it
|
147
|
-
expect(@tv[
|
144
|
+
it "should return a vote average" do
|
145
|
+
expect(@tv["vote_average"]).to eq 8.86764705882353
|
148
146
|
end
|
149
147
|
|
150
|
-
it
|
151
|
-
expect(@tv[
|
148
|
+
it "should return a vote count" do
|
149
|
+
expect(@tv["vote_count"]).to eq 34
|
152
150
|
end
|
153
151
|
end
|
154
152
|
|
155
|
-
describe
|
156
|
-
let(:append_fields) { %w
|
153
|
+
describe "For a TV detail with appended response" do
|
154
|
+
let(:append_fields) { %w[ credits external_ids ].join(",") }
|
157
155
|
|
158
156
|
before(:each) do
|
159
|
-
VCR.use_cassette
|
157
|
+
VCR.use_cassette "tv/detail_with_appeded_response" do
|
160
158
|
@tv = Tmdb::TV.detail(1396, append_to_response: append_fields)
|
161
159
|
end
|
162
160
|
end
|
163
161
|
|
164
|
-
it
|
165
|
-
expect(@tv[
|
166
|
-
expect(@tv[
|
167
|
-
expect(@tv[
|
168
|
-
expect(@tv[
|
162
|
+
it "should return credits" do
|
163
|
+
expect(@tv["credits"]["cast"].size).to eq 7
|
164
|
+
expect(@tv["credits"]["cast"].first["id"]).to eq 17_419
|
165
|
+
expect(@tv["credits"]["crew"].size).to eq 4
|
166
|
+
expect(@tv["credits"]["crew"].first["id"]).to eq 5162
|
169
167
|
end
|
170
168
|
|
171
|
-
it
|
172
|
-
expect(@tv[
|
169
|
+
it "should return external_ids" do
|
170
|
+
expect(@tv["external_ids"]["imdb_id"]).to eq "tt0903747"
|
173
171
|
end
|
174
172
|
end
|
175
173
|
|
176
|
-
describe
|
174
|
+
describe "For popular TV shows" do
|
177
175
|
before(:each) do
|
178
|
-
VCR.use_cassette
|
176
|
+
VCR.use_cassette "tv/popular" do
|
179
177
|
@tv = Tmdb::TV.popular
|
180
178
|
end
|
181
179
|
end
|
182
180
|
|
183
|
-
it
|
181
|
+
it "should return an array" do
|
184
182
|
expect(@tv.class).to eq Array
|
185
183
|
end
|
186
184
|
|
187
|
-
it
|
185
|
+
it "each show should return an id" do
|
188
186
|
expect(@tv.first.id).to eq 57_243
|
189
187
|
end
|
190
188
|
|
191
|
-
it
|
192
|
-
expect(@tv.first.name).to eq
|
189
|
+
it "each show should return an name" do
|
190
|
+
expect(@tv.first.name).to eq "Doctor Who"
|
193
191
|
end
|
194
192
|
|
195
|
-
it
|
196
|
-
expect(@tv.first.original_name).to eq
|
193
|
+
it "each show should return an original name" do
|
194
|
+
expect(@tv.first.original_name).to eq "Doctor Who"
|
197
195
|
end
|
198
196
|
|
199
|
-
it
|
197
|
+
it "each show should return an popularity" do
|
200
198
|
expect(@tv.first.popularity).to eq 16.5167252220739
|
201
199
|
end
|
202
200
|
|
203
|
-
it
|
204
|
-
expect(@tv.first.poster_path).to eq
|
201
|
+
it "each show should return an poster_path" do
|
202
|
+
expect(@tv.first.poster_path).to eq "/4a94ptIdYz0JwSzo0dCNuPCcfM8.jpg"
|
205
203
|
end
|
206
204
|
|
207
|
-
it
|
205
|
+
it "each show should return an vote_average" do
|
208
206
|
expect(@tv.first.vote_average).to eq 7.875
|
209
207
|
end
|
210
208
|
|
211
|
-
it
|
209
|
+
it "each show should return an vote_count" do
|
212
210
|
expect(@tv.first.vote_count).to eq 4
|
213
211
|
end
|
214
212
|
|
215
|
-
it
|
213
|
+
it "each show should return an backdrop" do
|
216
214
|
expect(@tv.first.backdrop_path).to eq nil
|
217
215
|
end
|
218
216
|
|
219
|
-
it
|
220
|
-
expect(@tv.first.first_air_date).to eq
|
217
|
+
it "each show should return an first air date" do
|
218
|
+
expect(@tv.first.first_air_date).to eq "2005-03-26"
|
221
219
|
end
|
222
220
|
end
|
223
221
|
|
224
|
-
describe
|
222
|
+
describe "For top rated TV shows" do
|
225
223
|
before(:each) do
|
226
|
-
VCR.use_cassette
|
224
|
+
VCR.use_cassette "tv/top_rated" do
|
227
225
|
@tv = Tmdb::TV.top_rated
|
228
226
|
end
|
229
227
|
end
|
230
228
|
|
231
|
-
it
|
229
|
+
it "should return an array" do
|
232
230
|
expect(@tv.class).to eq Array
|
233
231
|
end
|
234
232
|
|
235
|
-
it
|
233
|
+
it "each show should return an id" do
|
236
234
|
expect(@tv.first.id).to eq 1104
|
237
235
|
end
|
238
236
|
|
239
|
-
it
|
240
|
-
expect(@tv.first.name).to eq
|
237
|
+
it "each show should return an name" do
|
238
|
+
expect(@tv.first.name).to eq "Mad Men"
|
241
239
|
end
|
242
240
|
|
243
|
-
it
|
244
|
-
expect(@tv.first.original_name).to eq
|
241
|
+
it "each show should return an original name" do
|
242
|
+
expect(@tv.first.original_name).to eq "Mad Men"
|
245
243
|
end
|
246
244
|
|
247
|
-
it
|
245
|
+
it "each show should return an popularity" do
|
248
246
|
expect(@tv.first.popularity).to eq 2.15615937122719
|
249
247
|
end
|
250
248
|
|
251
|
-
it
|
252
|
-
expect(@tv.first.poster_path).to eq
|
249
|
+
it "each show should return an poster_path" do
|
250
|
+
expect(@tv.first.poster_path).to eq "/xA2nHrx2oHGPnL4ehBwPxD0ABvb.jpg"
|
253
251
|
end
|
254
252
|
|
255
|
-
it
|
253
|
+
it "each show should return an vote_average" do
|
256
254
|
expect(@tv.first.vote_average).to eq 9.66666666666667
|
257
255
|
end
|
258
256
|
|
259
|
-
it
|
257
|
+
it "each show should return an vote_count" do
|
260
258
|
expect(@tv.first.vote_count).to eq 3
|
261
259
|
end
|
262
260
|
|
263
|
-
it
|
264
|
-
expect(@tv.first.backdrop_path).to eq
|
261
|
+
it "each show should return an backdrop" do
|
262
|
+
expect(@tv.first.backdrop_path).to eq "/yGW0NX3I8GXPlWPdoWWyaH0AsCk.jpg"
|
265
263
|
end
|
266
264
|
|
267
|
-
it
|
268
|
-
expect(@tv.first.first_air_date).to eq
|
265
|
+
it "each show should return an first air date" do
|
266
|
+
expect(@tv.first.first_air_date).to eq "2007-07-19"
|
269
267
|
end
|
270
268
|
end
|
271
269
|
|
272
|
-
describe
|
273
|
-
describe
|
270
|
+
describe "For a TV shows images" do
|
271
|
+
describe "For backdrops" do
|
274
272
|
before(:each) do
|
275
|
-
VCR.use_cassette
|
276
|
-
@backdrop = Tmdb::TV.images(1396)[
|
273
|
+
VCR.use_cassette "tv/images" do
|
274
|
+
@backdrop = Tmdb::TV.images(1396)["backdrops"].first
|
277
275
|
end
|
278
276
|
end
|
279
277
|
|
280
|
-
it
|
281
|
-
expect(@backdrop[
|
278
|
+
it "should return a aspect ratio" do
|
279
|
+
expect(@backdrop["aspect_ratio"]).to eq 1.78
|
282
280
|
end
|
283
281
|
|
284
|
-
it
|
285
|
-
expect(@backdrop[
|
282
|
+
it "should return a file path" do
|
283
|
+
expect(@backdrop["file_path"]).to eq "/dRaV8HGx7Z9xmw77qSs8prp5OuI.jpg"
|
286
284
|
end
|
287
285
|
|
288
|
-
it
|
289
|
-
expect(@backdrop[
|
286
|
+
it "should return a height" do
|
287
|
+
expect(@backdrop["height"]).to eq 720
|
290
288
|
end
|
291
289
|
|
292
|
-
it
|
293
|
-
expect(@backdrop[
|
290
|
+
it "should return a iso code" do
|
291
|
+
expect(@backdrop["iso_639_1"]).to eq nil
|
294
292
|
end
|
295
293
|
|
296
|
-
it
|
297
|
-
expect(@backdrop[
|
294
|
+
it "should return a vote average" do
|
295
|
+
expect(@backdrop["vote_average"]).to eq 0.0
|
298
296
|
end
|
299
297
|
|
300
|
-
it
|
301
|
-
expect(@backdrop[
|
298
|
+
it "should return a vote count" do
|
299
|
+
expect(@backdrop["vote_count"]).to eq 0.0
|
302
300
|
end
|
303
301
|
|
304
|
-
it
|
305
|
-
expect(@backdrop[
|
302
|
+
it "should return a width" do
|
303
|
+
expect(@backdrop["width"]).to eq 1280
|
306
304
|
end
|
307
305
|
end
|
308
306
|
|
309
|
-
describe
|
307
|
+
describe "For posters" do
|
310
308
|
before(:each) do
|
311
|
-
VCR.use_cassette
|
312
|
-
@poster = Tmdb::TV.images(1396)[
|
309
|
+
VCR.use_cassette "tv/images" do
|
310
|
+
@poster = Tmdb::TV.images(1396)["posters"].first
|
313
311
|
end
|
314
312
|
end
|
315
313
|
|
316
|
-
it
|
317
|
-
expect(@poster[
|
314
|
+
it "should return a aspect ratio" do
|
315
|
+
expect(@poster["aspect_ratio"]).to eq 1.0
|
318
316
|
end
|
319
317
|
|
320
|
-
it
|
321
|
-
expect(@poster[
|
318
|
+
it "should return a file path" do
|
319
|
+
expect(@poster["file_path"]).to eq "/lVbofIPlw3kYa8FQgHT7GtWMI2Q.jpg"
|
322
320
|
end
|
323
321
|
|
324
|
-
it
|
325
|
-
expect(@poster[
|
322
|
+
it "should return a height" do
|
323
|
+
expect(@poster["height"]).to eq 1000
|
326
324
|
end
|
327
325
|
|
328
|
-
it
|
329
|
-
expect(@poster[
|
326
|
+
it "should return a iso code" do
|
327
|
+
expect(@poster["iso_639_1"]).to eq "nl"
|
330
328
|
end
|
331
329
|
|
332
|
-
it
|
333
|
-
expect(@poster[
|
330
|
+
it "should return a vote average" do
|
331
|
+
expect(@poster["vote_average"]).to eq 5.3125
|
334
332
|
end
|
335
333
|
|
336
|
-
it
|
337
|
-
expect(@poster[
|
334
|
+
it "should return a vote count" do
|
335
|
+
expect(@poster["vote_count"]).to eq 1
|
338
336
|
end
|
339
337
|
|
340
|
-
it
|
341
|
-
expect(@poster[
|
338
|
+
it "should return a width" do
|
339
|
+
expect(@poster["width"]).to eq 1000
|
342
340
|
end
|
343
341
|
end
|
344
342
|
end
|
345
343
|
|
346
|
-
describe
|
344
|
+
describe "For a TV shows cast" do
|
347
345
|
before(:each) do
|
348
|
-
VCR.use_cassette
|
346
|
+
VCR.use_cassette "tv/cast" do
|
349
347
|
@cast = Tmdb::TV.cast(1396).first
|
350
348
|
end
|
351
349
|
end
|
352
350
|
|
353
|
-
it
|
354
|
-
expect(@cast[
|
351
|
+
it "should return a id" do
|
352
|
+
expect(@cast["id"]).to eq 17_419
|
355
353
|
end
|
356
354
|
|
357
|
-
it
|
358
|
-
expect(@cast[
|
355
|
+
it "should return a name" do
|
356
|
+
expect(@cast["name"]).to eq "Bryan Cranston"
|
359
357
|
end
|
360
358
|
|
361
|
-
it
|
362
|
-
expect(@cast[
|
359
|
+
it "should return a order" do
|
360
|
+
expect(@cast["order"]).to eq 0
|
363
361
|
end
|
364
362
|
|
365
|
-
it
|
366
|
-
expect(@cast[
|
363
|
+
it "should return a profile image" do
|
364
|
+
expect(@cast["profile_path"]).to eq "/qXWgFCk4OJqmLRUBEj7cbp8dnkx.jpg"
|
367
365
|
end
|
368
366
|
|
369
|
-
it
|
370
|
-
expect(@cast[
|
367
|
+
it "should return a character name" do
|
368
|
+
expect(@cast["character"]).to eq "Walter White"
|
371
369
|
end
|
372
370
|
|
373
|
-
it
|
374
|
-
expect(@cast[
|
371
|
+
it "should return a credit id" do
|
372
|
+
expect(@cast["credit_id"]).to eq "52542282760ee313280017f9"
|
375
373
|
end
|
376
374
|
end
|
377
375
|
|
378
|
-
describe
|
376
|
+
describe "For a TV shows crew" do
|
379
377
|
before(:each) do
|
380
|
-
VCR.use_cassette
|
378
|
+
VCR.use_cassette "tv/crew" do
|
381
379
|
@crew = Tmdb::TV.crew(1396).first
|
382
380
|
end
|
383
381
|
end
|
384
382
|
|
385
|
-
it
|
386
|
-
expect(@crew[
|
383
|
+
it "should return a id" do
|
384
|
+
expect(@crew["id"]).to eq 29_779
|
387
385
|
end
|
388
386
|
|
389
|
-
it
|
390
|
-
expect(@crew[
|
387
|
+
it "should return a department" do
|
388
|
+
expect(@crew["department"]).to eq "Production"
|
391
389
|
end
|
392
390
|
|
393
|
-
it
|
394
|
-
expect(@crew[
|
391
|
+
it "should return a job" do
|
392
|
+
expect(@crew["job"]).to eq "Executive Producer"
|
395
393
|
end
|
396
394
|
|
397
|
-
it
|
398
|
-
expect(@crew[
|
395
|
+
it "should return a name" do
|
396
|
+
expect(@crew["name"]).to eq "Michelle MacLaren"
|
399
397
|
end
|
400
398
|
|
401
|
-
it
|
402
|
-
expect(@crew[
|
399
|
+
it "should return a profile image" do
|
400
|
+
expect(@crew["profile_path"]).to eq nil
|
403
401
|
end
|
404
402
|
end
|
405
403
|
|
406
|
-
describe
|
404
|
+
describe "For a TV shows external ids" do
|
407
405
|
before(:each) do
|
408
|
-
VCR.use_cassette
|
406
|
+
VCR.use_cassette "tv/external_ids" do
|
409
407
|
@external = Tmdb::TV.external_ids(1396)
|
410
408
|
end
|
411
409
|
end
|
412
410
|
|
413
|
-
it
|
414
|
-
expect(@external[
|
411
|
+
it "should return a id" do
|
412
|
+
expect(@external["id"]).to eq 1396
|
415
413
|
end
|
416
414
|
|
417
|
-
it
|
418
|
-
expect(@external[
|
415
|
+
it "should return a imdb id" do
|
416
|
+
expect(@external["imdb_id"]).to eq "tt0903747"
|
419
417
|
end
|
420
418
|
|
421
|
-
it
|
422
|
-
expect(@external[
|
419
|
+
it "should return a tvdb id" do
|
420
|
+
expect(@external["tvdb_id"]).to eq 81_189
|
423
421
|
end
|
424
422
|
|
425
|
-
it
|
426
|
-
expect(@external[
|
423
|
+
it "should return a tvrage id" do
|
424
|
+
expect(@external["tvrage_id"]).to eq 18_164
|
427
425
|
end
|
428
426
|
|
429
|
-
it
|
430
|
-
expect(@external[
|
427
|
+
it "should return a freebase id" do
|
428
|
+
expect(@external["freebase_id"]).to eq "/en/breaking_bad"
|
431
429
|
end
|
432
430
|
|
433
|
-
it
|
434
|
-
expect(@external[
|
431
|
+
it "should return a freebase mid" do
|
432
|
+
expect(@external["freebase_mid"]).to eq "/m/03d34x8"
|
435
433
|
end
|
436
434
|
end
|
437
435
|
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.themoviedb.org/3/keyword/818?api_key=8a221fc31fcdf12a8af827465574ffc9
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
Access-Control-Allow-Origin:
|
20
|
+
- "*"
|
21
|
+
Cache-Control:
|
22
|
+
- public, max-age=28800
|
23
|
+
Content-Type:
|
24
|
+
- application/json;charset=utf-8
|
25
|
+
Date:
|
26
|
+
- Thu, 02 Mar 2017 10:00:26 GMT
|
27
|
+
Etag:
|
28
|
+
- '"b936ef391d4c4df37185dfa8b58523c2"'
|
29
|
+
Server:
|
30
|
+
- openresty
|
31
|
+
Status:
|
32
|
+
- 200 OK
|
33
|
+
X-Memc:
|
34
|
+
- HIT
|
35
|
+
X-Memc-Age:
|
36
|
+
- '781'
|
37
|
+
X-Memc-Expires:
|
38
|
+
- '28019'
|
39
|
+
X-Memc-Key:
|
40
|
+
- 3f27be7884efa986cf8d000e43358b3f
|
41
|
+
X-Ratelimit-Limit:
|
42
|
+
- '40'
|
43
|
+
X-Ratelimit-Remaining:
|
44
|
+
- '25'
|
45
|
+
X-Ratelimit-Reset:
|
46
|
+
- '1488448833'
|
47
|
+
Content-Length:
|
48
|
+
- '34'
|
49
|
+
Connection:
|
50
|
+
- keep-alive
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: '{"id":818,"name":"based on novel"}'
|
54
|
+
http_version:
|
55
|
+
recorded_at: Thu, 02 Mar 2017 10:00:23 GMT
|
56
|
+
recorded_with: VCR 3.0.0
|