Sha256: 25d9243ffb70e2f48dee2bf1cf9ec6c8b0d46d520bd8eb07defb0f3244e26f2b

Contents?: true

Size: 1.5 KB

Versions: 4

Compression:

Stored size: 1.5 KB

Contents

describe FilmSnob::Dailymotion do
  it "should parse https dailymotion URLs" do
    url = "https://www.dailymotion.com/video/xf02xp_uffie-difficult_music"
    snob = FilmSnob.new(url)
    expect(snob.id).to eq "xf02xp_uffie-difficult_music"
    expect(snob.site).to eq :dailymotion
    VCR.use_cassette("dailymotion/music") do
      expect(snob.title).to eq "Uffie - Difficult"
    end
  end

  it "should parse http dailymotion URLs" do
    url = "http://www.dailymotion.com/video/xf02xp_uffie-difficult_music"
    snob = FilmSnob.new(url)
    expect(snob.id).to eq "xf02xp_uffie-difficult_music"
    expect(snob.site).to eq :dailymotion
  end

  it "should parse mobile dailymotion URLs" do
    url = "http://touch.dailymotion.com/video/xf02xp_uffie-difficult_music"
    clean = "https://www.dailymotion.com/video/xf02xp_uffie-difficult_music"
    snob = FilmSnob.new(url)
    expect(snob.id).to eq "xf02xp_uffie-difficult_music"
    expect(snob.site).to eq :dailymotion
    expect(snob.clean_url).to eq clean
  end

  it "should allow oembed configuration" do
    snob = FilmSnob.new(
      "http://www.dailymotion.com/video/xf02xp_uffie-difficult_music",
      :maxwidth => 400
    )
    VCR.use_cassette("dailymotion/music1") do
      expect(snob.html).to match(/width="400"/)
    end

    snob2 = FilmSnob.new(
      "http://www.dailymotion.com/video/xf02xp_uffie-difficult_music",
      :maxwidth => 500
    )
    VCR.use_cassette("dailymotion/music500") do
      expect(snob2.html).to match(/width="500"/)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
film_snob-2.0.0 spec/film_snob/oembed_providers/dailymotion_spec.rb
film_snob-1.0.1 spec/film_snob/oembed_providers/dailymotion_spec.rb
film_snob-1.0.0 spec/film_snob/oembed_providers/dailymotion_spec.rb
film_snob-0.6.5 spec/film_snob/video_sites/dailymotion_spec.rb