Sha256: 384c4942bb91af2bd949c26f904a1b546ffffa7e6f5f7cee8d690ffe78b1fc80

Contents?: true

Size: 977 Bytes

Versions: 34

Compression:

Stored size: 977 Bytes

Contents

require "spec_helper"

describe Onebox::Engine::AudioOnebox do
  it "supports ogg" do
    Onebox.preview('http://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg').to_s.should match(/<audio/)
  end

  it "supports mp3" do
    Onebox.preview('http://kolber.github.io/audiojs/demos/mp3/juicy.mp3').to_s.should match(/<audio/)
  end

  it "supports wav" do
    Onebox.preview('http://download.wavetlan.com/SVV/Media/HTTP/sample14.wav').to_s.should match(/<audio/)
  end

  it "supports URLs with query parameters" do
    Onebox.preview('https://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg?foo=bar').to_s.should match(/<audio/)
  end

  it "supports protocol relative URLs" do
    Onebox.preview('//upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg').to_s.should match(/<audio/)
  end
  
  it "includes a fallback direct link to the audio" do
    Onebox.preview('http://kolber.github.io/audiojs/demos/mp3/juicy.mp3').to_s.should match(/<a.*mp3/)
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
onebox-1.4.4 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.4.3 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.4.2 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.4.1 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.4.0 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.3.9 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.3.8 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.3.7 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.3.6 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.3.5 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.3.4 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.3.3 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.3.2 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.3.1 spec/lib/onebox/engine/audio_onebox_spec.rb