Sha256: 7327d1a13c87bef706c4d77a08469b0301b3963534e91dac9404e5a1b12f3b17

Contents?: true

Size: 590 Bytes

Versions: 7

Compression:

Stored size: 590 Bytes

Contents

require 'spec_helper'

describe Onebox::Engine::YoutubeOnebox do
  before do
    fake("https://www.youtube.com/watch?v=21Lk4YiASMo", response("youtube"))
    fake("http://www.youtube.com/oembed?format=json&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D21Lk4YiASMo", response("youtube-json"))
  end

  it "should add wmode=opaque" do
    Onebox.preview('https://www.youtube.com/watch?v=21Lk4YiASMo').to_s.should match(/wmode=opaque/)
  end

  it "should rewrite URLs to be agnostic" do
    Onebox.preview('https://www.youtube.com/watch?v=21Lk4YiASMo').to_s.should match(/"\/\//)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
onebox-1.2.6 spec/lib/onebox/engine/youtube_onebox_spec.rb
onebox-1.2.5 spec/lib/onebox/engine/youtube_onebox_spec.rb
onebox-1.2.4 spec/lib/onebox/engine/youtube_onebox_spec.rb
onebox-1.2.3 spec/lib/onebox/engine/youtube_onebox_spec.rb
onebox-1.2.2 spec/lib/onebox/engine/youtube_onebox_spec.rb
onebox-1.2.1 spec/lib/onebox/engine/youtube_onebox_spec.rb
onebox-1.2.0 spec/lib/onebox/engine/youtube_onebox_spec.rb