Sha256: 6e94bc95a695404bfc4b2a51a6c8999a126fcf7c71157f62f75b287aad2bfd71

Contents?: true

Size: 1.7 KB

Versions: 5

Compression:

Stored size: 1.7 KB

Contents

require 'test_helper'

class AttachmentMagick::ImageTest < ActiveSupport::TestCase
  setup do
    create_artist
    create_place
  end

  def test_create_thumb_for_vimeo_in_a_new_field
    @artist_image = @artist.images.create({:source => 'http://vimeo.com/14074949'})
    @place_image  = @place.images.create({:source => 'http://vimeo.com/14074949'})

    assert_equal %'<iframe src=\"http://player.vimeo.com/video/14074949?title=0&byline=0&portrait=0\" width=\"620\" height=\"465\" frameborder=\"0\"></iframe>', @artist_image.source_to_html
    assert_equal 'http://b.vimeocdn.com/ts/937/359/93735969_640.jpg', @artist_image.source_to_image
    assert_equal %'<iframe src=\"http://player.vimeo.com/video/14074949?title=0&byline=0&portrait=0\" width=\"620\" height=\"465\" frameborder=\"0\"></iframe>', @place_image.source_to_html
    assert_equal 'http://b.vimeocdn.com/ts/937/359/93735969_640.jpg', @place_image.source_to_image
  
    @artist_image = @artist.images.create({:source => 'http://www.youtube.com/watch?v=FUe83k3t_0s'})
    @place_image  = @place.images.create({:source => 'http://www.youtube.com/watch?v=FUe83k3t_0s'})
    
    assert_equal %'<iframe class="youtube-player" type="text/html" width="620" height="465" src="http://www.youtube.com/embed/FUe83k3t_0s" frameborder="0">\n</iframe>', @artist_image.source_to_html
    assert_equal 'http://i1.ytimg.com/vi/FUe83k3t_0s/default.jpg', @artist_image.source_to_image
    assert_equal %'<iframe class="youtube-player" type="text/html" width="620" height="465" src="http://www.youtube.com/embed/FUe83k3t_0s" frameborder="0">\n</iframe>', @place_image.source_to_html
    assert_equal 'http://i1.ytimg.com/vi/FUe83k3t_0s/default.jpg', @place_image.source_to_image
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
attachment_magick-0.2.3 test/attachment_magick/units/image_test.rb
attachment_magick-0.2.2 test/attachment_magick/units/image_test.rb
attachment_magick-0.2.1 test/attachment_magick/units/image_test.rb
attachment_magick-0.2.0 test/attachment_magick/units/image_test.rb
attachment_magick-0.1.0 test/attachment_magick/units/image_test.rb