odeon_uk 3.0.5 → 3.0.6
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/lib/odeon_uk/html/website.rb +2 -0
- data/lib/odeon_uk/version.rb +2 -2
- data/test/lib/odeon_uk/html/website_test.rb +39 -9
- data/test/support/website_fixtures_helper.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b082f5c0f73fda6b73b03492919f702c184722c
|
4
|
+
data.tar.gz: c870a782f33abddea4a316059cda6ff3d20b8534
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51cd7609ee9c4a39719830d96e3a6d29ac1263001105e0c7e1aac73f39e65aaeeebf66583a5071e65876470c463826eae07fe34ba2c0ab8d1c7482ac340dc6e2
|
7
|
+
data.tar.gz: 6b1a5702be7e67792bf5f3561bfdaab2f3064f43c977dbb9271456324054f799bee201f92621f20e84acadc6558b85238a32ad8c04bd3f08dbbac29a86f37c45
|
data/CHANGELOG.md
CHANGED
data/lib/odeon_uk/version.rb
CHANGED
@@ -8,30 +8,60 @@ describe OdeonUk::Html::Website do
|
|
8
8
|
describe '#cinema(id)' do
|
9
9
|
subject { described_class.new.cinema(71) }
|
10
10
|
|
11
|
-
|
11
|
+
describe 'successful http request' do
|
12
|
+
before { stub_get('cinemas/odeon/71/', cinema_html(71)) }
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
it 'returns a string' do
|
15
|
+
subject.class.must_equal String
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe 'unsuccessful http request' do
|
20
|
+
before { stub_get_with_500('cinemas/odeon/71/') }
|
21
|
+
|
22
|
+
it 'returns an empty string' do
|
23
|
+
subject.must_equal ''
|
24
|
+
end
|
15
25
|
end
|
16
26
|
end
|
17
27
|
|
18
28
|
describe '#sitemap' do
|
19
29
|
subject { described_class.new.sitemap }
|
20
30
|
|
21
|
-
|
31
|
+
describe 'successful http request' do
|
32
|
+
before { stub_get('sitemap/', sitemap_html) }
|
22
33
|
|
23
|
-
|
24
|
-
|
34
|
+
it 'returns a string' do
|
35
|
+
subject.class.must_equal String
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe 'unsuccessful http request' do
|
40
|
+
before { stub_get_with_500('sitemap/') }
|
41
|
+
|
42
|
+
it 'returns an empty string' do
|
43
|
+
subject.must_equal ''
|
44
|
+
end
|
25
45
|
end
|
26
46
|
end
|
27
47
|
|
28
48
|
describe '#showtimes(id)' do
|
29
49
|
subject { described_class.new.showtimes(71) }
|
30
50
|
|
31
|
-
|
51
|
+
describe 'successful http request' do
|
52
|
+
before { stub_get('showtimes/week/71/?siteId=71', showtimes_html(71)) }
|
53
|
+
|
54
|
+
it 'returns a string' do
|
55
|
+
subject.class.must_equal String
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
describe 'unsuccessful http request' do
|
60
|
+
before { stub_get_with_500('showtimes/week/71/?siteId=71') }
|
32
61
|
|
33
|
-
|
34
|
-
|
62
|
+
it 'returns an empty string' do
|
63
|
+
subject.must_equal ''
|
64
|
+
end
|
35
65
|
end
|
36
66
|
end
|
37
67
|
end
|
@@ -17,6 +17,11 @@ module WebsiteFixturesHelper
|
|
17
17
|
File.read(File.expand_path("../../fixtures/#{filepath}.html", __FILE__))
|
18
18
|
end
|
19
19
|
|
20
|
+
def stub_get_with_500(site_path)
|
21
|
+
url = "http://www.odeon.co.uk/#{site_path}"
|
22
|
+
stub_request(:get, url).to_return(status: [500, 'Internal Server Error'])
|
23
|
+
end
|
24
|
+
|
20
25
|
def stub_get(site_path, response_body)
|
21
26
|
url = "http://www.odeon.co.uk/#{site_path}"
|
22
27
|
response = { status: 200, body: response_body, headers: {} }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: odeon_uk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Croll
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|