Sha256: b2844141008f816777613d29f62bab71e96aa91bd4712e753a7ff9d74150896e

Contents?: true

Size: 1.1 KB

Versions: 17

Compression:

Stored size: 1.1 KB

Contents

require "spec_helper"

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

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

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

  it "supports m4a" do
    expect(Onebox.preview('http://techslides.com/demos/samples/sample.m4a').to_s).to match(/<audio/)
  end

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

  it "supports protocol relative URLs" do
    expect(Onebox.preview('//upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg').to_s).to match(/<audio/)
  end

  it "includes a fallback direct link to the audio" do
    expect(Onebox.preview('http://kolber.github.io/audiojs/demos/mp3/juicy.mp3').to_s).to match(/<a.*mp3/)
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
onebox-1.6.5 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.6.4 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.6.3 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.6.2 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.6.1 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.6.0 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.65 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.64 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.63 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.62 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.61 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.60 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.50 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.49 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.48 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.47 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.45 spec/lib/onebox/engine/audio_onebox_spec.rb