odeon_uk 3.0.3 → 3.0.4
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 +5 -0
- data/lib/odeon_uk/api/cinema.rb +5 -0
- data/lib/odeon_uk/version.rb +2 -2
- data/test/lib/odeon_uk/api/cinema_test.rb +17 -1
- data/test/lib/odeon_uk/cinema_test.rb +2 -2
- 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: a93bd99698e1107ba48963d63c856bb30db8fe04
|
4
|
+
data.tar.gz: 0f34f24b21b31c018ee33973125cdabd6db51407
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e457d07343eeac1b78ccbb80f1b1821ac83e11c8e24c6d77e8cf2ab0bffd8b4c724794b787f17f7f291f22e2c41f94baf0b80c226308680835fcfe1a6350b312
|
7
|
+
data.tar.gz: d96d6d0229ca9408259d1f798b3fa6ea88430a318cd7f09bc831c5c6154f79a8e95b04def2728ed5cf047dc6e130e809b8722669b461356763a83291cd0afc48
|
data/CHANGELOG.md
CHANGED
data/lib/odeon_uk/api/cinema.rb
CHANGED
@@ -34,6 +34,7 @@ module OdeonUk
|
|
34
34
|
# The url of the cinema
|
35
35
|
# @return [Nil]
|
36
36
|
def url
|
37
|
+
"http://www.odeon.co.uk/cinemas/#{urlized_name}/#{@id}/"
|
37
38
|
end
|
38
39
|
|
39
40
|
# Post code of the cinema
|
@@ -57,6 +58,10 @@ module OdeonUk
|
|
57
58
|
def cinema_hash
|
58
59
|
@cinema_hash ||= self.class.cinemas_hash[id.to_s]
|
59
60
|
end
|
61
|
+
|
62
|
+
def urlized_name
|
63
|
+
name.downcase.gsub(/[^a-z0-9]/, '_')
|
64
|
+
end
|
60
65
|
end
|
61
66
|
end
|
62
67
|
end
|
data/lib/odeon_uk/version.rb
CHANGED
@@ -72,7 +72,7 @@ describe OdeonUk::Api::Cinema do
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
75
|
-
|
75
|
+
|
76
76
|
describe '#locality' do
|
77
77
|
subject { described_class.new(id).locality }
|
78
78
|
|
@@ -146,4 +146,20 @@ describe OdeonUk::Api::Cinema do
|
|
146
146
|
end
|
147
147
|
end
|
148
148
|
end
|
149
|
+
|
150
|
+
describe '#url' do
|
151
|
+
subject { described_class.new(id).url }
|
152
|
+
|
153
|
+
describe 'short address' do
|
154
|
+
let(:id) { 71 }
|
155
|
+
|
156
|
+
before { response.expect(:all_cinemas, parse(all_cinemas_plist)) }
|
157
|
+
|
158
|
+
it 'returns first line of address' do
|
159
|
+
OdeonUk::Api::Response.stub :new, response do
|
160
|
+
subject.must_equal 'http://www.odeon.co.uk/cinemas/brighton/71/'
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
149
165
|
end
|
@@ -295,7 +295,7 @@ describe OdeonUk::Cinema do
|
|
295
295
|
subject.brand.must_equal 'Odeon'
|
296
296
|
subject.name.must_equal 'Brighton'
|
297
297
|
subject.slug.must_equal 'odeon-brighton'
|
298
|
-
subject.url.
|
298
|
+
subject.url.must_equal 'http://www.odeon.co.uk/cinemas/brighton/71/'
|
299
299
|
end
|
300
300
|
end
|
301
301
|
end
|
@@ -472,7 +472,7 @@ describe OdeonUk::Cinema do
|
|
472
472
|
|
473
473
|
it 'returns the brand in the name' do
|
474
474
|
OdeonUk::Api::Response.stub :new, response do
|
475
|
-
subject.
|
475
|
+
subject.must_equal 'http://www.odeon.co.uk/cinemas/brighton/71/'
|
476
476
|
end
|
477
477
|
end
|
478
478
|
end
|
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.4
|
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-05-
|
11
|
+
date: 2015-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|