Sha256: 5d25f9317d424fb1225383bbb57954b288d96f6ecdd3324898d76a740227b731
Contents?: true
Size: 1.31 KB
Versions: 6
Compression:
Stored size: 1.31 KB
Contents
require_relative '../../../test_helper' describe PicturehouseUk::Internal::CinemaPage do let(:described_class) { PicturehouseUk::Internal::CinemaPage } let(:website) { Minitest::Mock.new } before do WebMock.disable_net_connect! end describe '#film_html' do subject { described_class.new('Duke_Of_Yorks').film_html } before do website.expect(:cinema, dukes_html, ['Duke_Of_Yorks']) end it 'returns an non-zero array of film screenings html fragments' do PicturehouseUk::Internal::Website.stub :new, website do subject.must_be_instance_of(Array) subject.size.must_be :>, 0 subject.each do |film_html| film_html.must_be_instance_of(String) film_html.size.must_be :>, 0 end end end it 'returns an array with correct content' do PicturehouseUk::Internal::Website.stub :new, website do subject[1..-1].each do |html| html.must_include('class="imageborder"') # poster html.must_include('class="movielink"') # title html.must_include('epoch="') # screening end end end end private def read_file(filepath) File.read(File.expand_path(filepath, __FILE__)) end def dukes_html read_file('../../../../fixtures/cinema/Duke_Of_Yorks.html') end end
Version data entries
6 entries across 6 versions & 1 rubygems