picturehouse_uk 3.0.10 → 3.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ describe PicturehouseUk::Internal::Parser::Screenings do
10
10
  end
11
11
 
12
12
  %w(Duke_Of_Yorks Dukes_At_Komedia Phoenix_Picturehouse).each do |cinema|
13
- describe '#to_a' do
13
+ describe "#{cinema}: #to_a" do
14
14
  subject { described_class.new(cinema).to_a }
15
15
 
16
16
  before { website.expect(:cinema, html(cinema), [cinema]) }
@@ -25,9 +25,36 @@ describe PicturehouseUk::Internal::Parser::Screenings do
25
25
  element.keys.must_equal([:film_name, :dimension, :variant, :booking_url, :time])
26
26
  element[:film_name].must_be_kind_of(String)
27
27
  element[:dimension].must_match(/\A[23]d\z/)
28
- # element[:booking_url].must_match(/\Ahttps?\:\/\//)
28
+ if element[:booking_url]
29
+ element[:booking_url].must_match(/\Ahttps?\:\/\//)
30
+ element[:booking_url].must_match(/ticketing/)
31
+ element[:booking_url].must_match(/visSelectTickets\.aspx\?cinemacode=\d+\&txtSessionId=\d+/)
32
+ end
29
33
  element[:time].must_be_kind_of(Time)
30
34
  end
35
+
36
+ variants = subject.flat_map { |e| e[:variant] }.uniq
37
+ %w(arts baby senior).each do |expected| # also kids
38
+ variants.must_include(expected)
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+
45
+ %w(National_Media_Museum).each do |cinema|
46
+ describe "#{cinema}: #to_a" do
47
+ subject { described_class.new(cinema).to_a }
48
+
49
+ before { website.expect(:cinema, html(cinema), [cinema]) }
50
+
51
+ it 'returns an non-zero array of hashes with imax variants' do
52
+ PicturehouseUk::Internal::Website.stub :new, website do
53
+ subject.must_be_instance_of(Array)
54
+ subject.size.must_be :>, 0
55
+
56
+ variants = subject.flat_map { |e| e[:variant] }.uniq
57
+ variants.must_include('imax')
31
58
  end
32
59
  end
33
60
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picturehouse_uk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.10
4
+ version: 3.0.11
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-04-12 00:00:00.000000000 Z
11
+ date: 2015-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -137,6 +137,7 @@ files:
137
137
  - test/fixture_updater.rb
138
138
  - test/fixtures/cinema/Duke_Of_Yorks.html
139
139
  - test/fixtures/cinema/Dukes_At_Komedia.html
140
+ - test/fixtures/cinema/National_Media_Museum.html
140
141
  - test/fixtures/cinema/Phoenix_Picturehouse.html
141
142
  - test/fixtures/home.html
142
143
  - test/fixtures/info/Duke_Of_Yorks.html
@@ -180,6 +181,7 @@ test_files:
180
181
  - test/fixture_updater.rb
181
182
  - test/fixtures/cinema/Duke_Of_Yorks.html
182
183
  - test/fixtures/cinema/Dukes_At_Komedia.html
184
+ - test/fixtures/cinema/National_Media_Museum.html
183
185
  - test/fixtures/cinema/Phoenix_Picturehouse.html
184
186
  - test/fixtures/home.html
185
187
  - test/fixtures/info/Duke_Of_Yorks.html