Sha256: 4860739cc6f36e4b46e431b095093afc6fba4298cccb54434fef7c8a90474f84

Contents?: true

Size: 769 Bytes

Versions: 1

Compression:

Stored size: 769 Bytes

Contents

require File.expand_path('spec/spec_helper')

describe UrlToMediaTag do
  it "has a VERSION" do
    UrlToMediaTag::VERSION.should =~ /^\d+\.\d+\.\d+$/
  end

  describe 'convert' do
    it "converts youtube" do
      expected = "<iframe class=\"youtube-player\" type=\"text/html\" width=\"640\" height=\"480\" src=\"http://www.youtube.com/embed/kW-dS4otEZU\" frameborder=\"\"></iframe>"
      UrlToMediaTag.convert('http://www.youtube.com/watch?v=kW-dS4otEZU').should == expected
    end

    it "converts vimeo" do
      expected = "<iframe src=\"http://player.vimeo.com/video/26881896?title=0&byline=0&portrait=0\" width=\"640\" height=\"480\" frameborder=\"0\"></iframe>"
      UrlToMediaTag.convert('http://vimeo.com/26881896').should == expected
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
url_to_media_tag-0.1.0 spec/url_to_media_tag_spec.rb