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.5.17 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.16 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.14 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.13 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.12 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.11 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.10 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.9 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.8 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.7 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.6 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.5 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.3 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.2 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.1 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.0 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.4.9 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.4.8 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.4.7 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.4.5 spec/lib/onebox/engine/audio_onebox_spec.rb