Sha256: 524230642f41f083e28bf9eae3db7b244987315ab3deca0e240a63115dcc9a94

Contents?: true

Size: 951 Bytes

Versions: 1

Compression:

Stored size: 951 Bytes

Contents

require "spec_helper"

describe Onebox::Engine::HuluOnebox do
  before(:all) do
    @link = "http://www.hulu.com/watch/515146"
    fake(@link, response(described_class.template_name))
  end
  before(:each) { Onebox.defaults.cache.clear }

  let(:link) { @link }

  it_behaves_like "an engine"

  describe "#to_html" do
    let(:html) { described_class.new(link).to_html }

    it "returns video title" do
      expect(html).to include("The Awesomes: Pilot, Part 1")
    end

    it "returns photo" do
      expect(html).to include("http://ib3.huluim.com/video/60245466?region=US&size=600x400")
    end

    it "returns video description" do
      expect(html).to include("After Mr. Awesome decides to retire and disband The Awesomes")
    end

    it "returns video URL" do
      expect(html).to include("https://secure.hulu.com/embed/0-us7uHJgevua5TeiGwCxQ")
    end

    it "returns URL" do
      expect(html).to include(link)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
onebox-1.1.0 spec/lib/onebox/engine/hulu_onebox_spec.rb