Sha256: 3fbcc5ee9e2e953bd13f780b8f2b75de8d3b36884706f80bca1cd3a58b979659

Contents?: true

Size: 1.61 KB

Versions: 5

Compression:

Stored size: 1.61 KB

Contents

require 'spec_helper'

describe Poms::Broadcast do

  let(:poms_broadcast) { Fabricate(:poms_broadcast) }
  # pippi langkous is a peculiar case, as it has no series, just a season
  let(:poms_pippi_langkous) { Fabricate(:poms_broadcast_pippi_langkous) }

  it 'correctly sets the series' do
    expect(poms_broadcast.serie_mid).to eq('POMS_S_KRO_059857')
  end

  it 'correctly sets the title' do
    expect(poms_broadcast.title).to eq('VRijland afl.64 & 65 (herhaling)')
  end

  it 'correctly sets the description' do
    description = "Li biedt Barry een baantje aan bij de uitdragerij en vraagt zich meteen af of dat wel zo slim was. Timon en Joep zien de criminele organisatie de Rijland Angels. Timon wil naar hun loods, maar is dat wel een goed idee?"
    expect(poms_broadcast.description).to eq(description)
  end

  it 'converts schedule events to Poms::ScheduleEvent'  do
    poms_broadcast.schedule_events.each do |e|
      expect(e.class).to eq(Poms::ScheduleEvent)
    end
  end

  it 'correctly sets available until' do
    expect(poms_broadcast.available_until).to eq(Time.at(1369758599).to_datetime)
  end

  it 'sets the serie correctly when a broadcast only has a season, no series' do
    expect(poms_pippi_langkous.serie_mid).to eq('POW_00107959')
  end

  it 'returns the available streams' do
    expect(poms_broadcast.odi_streams).to eq(["adaptive", "h264_sb", "h264_bb", "h264_std", "wvc1_std", "wmv_sb", "wmv_bb"])
  end

  it 'return the ancestors of the broadcast' do
    # I use to_set as the order does not matter
    expect(poms_broadcast.ancestor_mids.to_set).to eq(['POMS_S_KRO_059857', 'KRO_1521173'].to_set)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
poms-0.0.8 spec/lib/poms/broadcast_spec.rb
poms-0.0.6 spec/lib/poms/broadcast_spec.rb
poms-0.0.5 spec/lib/poms/broadcast_spec.rb
poms-0.0.4 spec/lib/poms/broadcast_spec.rb
poms-0.0.3 spec/lib/poms/broadcast_spec.rb