Sha256: 5a02fc58b3efac1fc628935b7932d6c6b7b0c5da95681a3307830cfbaf3981ec

Contents?: true

Size: 1001 Bytes

Versions: 27

Compression:

Stored size: 1001 Bytes

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 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

27 entries across 27 versions & 1 rubygems

Version Path
onebox-1.5.24 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.23 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.22 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.21 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.20 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.19 spec/lib/onebox/engine/audio_onebox_spec.rb
onebox-1.5.18 spec/lib/onebox/engine/audio_onebox_spec.rb