blinkbox_films 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blinkbox_films/search.rb +3 -3
- data/spec/feature/film_page_spec.rb +7 -7
- data/spec/feature/search_spec.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee968e82576c6b0bfaf44234d51aeeaf636e5cec
|
4
|
+
data.tar.gz: c2cc73c595fc34669f067e471b355d25ab865eea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0034f1f4eb088c504c85c09f8d380ab70ace046f22394c09e0e0cf0dbbc996924d39fd03fee631cdb8ce26d55474df363d148f75cf294dfdee0352e90fbfc09a
|
7
|
+
data.tar.gz: 242d044a0d68cbb09b13c3d32a805e9edfa58414b89c490fcc68bdfa1f6c56c33810ef924b765afb234aee6c48dccedce862a6aacd04c76b6f6489c8c16ac9b3
|
@@ -29,7 +29,7 @@ module BlinkboxFilms
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def response(query)
|
32
|
-
HTTPClient.new.get('
|
32
|
+
HTTPClient.new.get('https://www.talktalktvstore.co.uk/search', { 'Search' => query })
|
33
33
|
end
|
34
34
|
|
35
35
|
def film_fragments(page)
|
@@ -42,8 +42,8 @@ module BlinkboxFilms
|
|
42
42
|
|
43
43
|
def film_url(fragment)
|
44
44
|
u = URI.parse(extract_film_path_or_url(fragment))
|
45
|
-
u.host ||= 'www.
|
46
|
-
u.scheme ||= '
|
45
|
+
u.host ||= 'www.talktalktvstore.co.uk'
|
46
|
+
u.scheme ||= 'https'
|
47
47
|
u.to_s
|
48
48
|
end
|
49
49
|
|
@@ -3,11 +3,11 @@ require 'blinkbox_films'
|
|
3
3
|
|
4
4
|
describe 'A film page', :vcr do
|
5
5
|
context 'A film' do
|
6
|
-
subject { BlinkboxFilms::FilmPage.from_url('
|
6
|
+
subject { BlinkboxFilms::FilmPage.from_url('https://www.talktalktvstore.co.uk/movies/the-dark-knight-(28710)').film }
|
7
7
|
|
8
8
|
it { expect(subject.title).to eq('The Dark Knight') }
|
9
|
-
it { expect(subject.url).to eq('
|
10
|
-
it { expect(subject.image_url).to
|
9
|
+
it { expect(subject.url).to eq('https://www.talktalktvstore.co.uk/movies/the-dark-knight-(28710)') }
|
10
|
+
it { expect(subject.image_url).to eq('https://fa-i-p1.ttcdn.uk/i/contentasset3/000/028/710/gl0lloqf/v=319/w=215;h=306;rm=Crop;q=85/image.jpg') }
|
11
11
|
it { expect(subject.release_year).to eq(2008) }
|
12
12
|
it { expect(subject.certificate).to eq('12') }
|
13
13
|
it { expect(subject.running_time_in_minutes).to eq(152) }
|
@@ -15,12 +15,12 @@ describe 'A film page', :vcr do
|
|
15
15
|
it { expect(subject.buy_price).to eq('£6.99') }
|
16
16
|
end
|
17
17
|
|
18
|
-
context 'A TV
|
19
|
-
subject { BlinkboxFilms::FilmPage.from_url('
|
18
|
+
context 'A single TV series' do
|
19
|
+
subject { BlinkboxFilms::FilmPage.from_url('https://www.talktalktvstore.co.uk/tv/12-monkeys-(2313)/s01-(3555)').film }
|
20
20
|
|
21
21
|
it { expect(subject.title).to eq('12 Monkeys') }
|
22
|
-
it { expect(subject.url).to eq('
|
23
|
-
it { expect(subject.image_url).to
|
22
|
+
it { expect(subject.url).to eq('https://www.talktalktvstore.co.uk/tv/12-monkeys-(2313)/s01-(3555)') }
|
23
|
+
it { expect(subject.image_url).to eq('https://fa-i-p1.ttcdn.uk/i/tvseries/000/002/313/yzr3t1rw/v=319/w=215;h=306;rm=Crop;q=85/image.jpg') }
|
24
24
|
it { expect(subject.release_year).to eq(2015) }
|
25
25
|
it { expect(subject.certificate).to eq('15') }
|
26
26
|
it { expect(subject.running_time_in_minutes).to be_nil }
|
data/spec/feature/search_spec.rb
CHANGED
@@ -11,8 +11,8 @@ describe 'A search' do
|
|
11
11
|
|
12
12
|
it { expect(subject).to_not be_empty }
|
13
13
|
it { expect(subject.first.title).to eq('The Dark Knight') }
|
14
|
-
it { expect(subject.first.url).to eq('
|
15
|
-
it { expect(subject.first.image_url).to eq('
|
14
|
+
it { expect(subject.first.url).to eq('https://www.talktalktvstore.co.uk/movies/the-dark-knight-(28710)') }
|
15
|
+
it { expect(subject.first.image_url).to eq('https://fa-i-p1.ttcdn.uk/i/contentasset31/000/028/710/1gkiab4e/v=319/w=234;h=132;rm=Crop;q=85/image.jpg') }
|
16
16
|
it { expect(subject.first.certificate).to eq('12') }
|
17
17
|
it { expect(subject.first.running_time_in_minutes).to eq(152) }
|
18
18
|
end
|
@@ -21,7 +21,7 @@ describe 'A search' do
|
|
21
21
|
before do
|
22
22
|
VCR.turn_off!
|
23
23
|
|
24
|
-
stub_request(:get, "
|
24
|
+
stub_request(:get, "https://www.talktalktvstore.co.uk/search?Search=dark%20knight").
|
25
25
|
to_return(:body => '<html><body><h1>Not what you expected</h1></body></html>')
|
26
26
|
end
|
27
27
|
|