Sha256: ad5d82ff70acb644e91693aa4ba459bb8faa1e2274888dd59bd05c8ab8568808

Contents?: true

Size: 1.7 KB

Versions: 11

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/819/560/81956031_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/819/560/81956031_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

11 entries across 11 versions & 1 rubygems

Version Path
attachment_magick-0.3.6 test/attachment_magick/units/image_test.rb
attachment_magick-0.3.5 test/attachment_magick/units/image_test.rb
attachment_magick-0.3.4 test/attachment_magick/units/image_test.rb
attachment_magick-0.3.3 test/attachment_magick/units/image_test.rb
attachment_magick-0.3.2 test/attachment_magick/units/image_test.rb
attachment_magick-0.3.1 test/attachment_magick/units/image_test.rb
attachment_magick-0.3 test/attachment_magick/units/image_test.rb
attachment_magick-0.2.7 test/attachment_magick/units/image_test.rb
attachment_magick-0.2.6 test/attachment_magick/units/image_test.rb
attachment_magick-0.2.5 test/attachment_magick/units/image_test.rb
attachment_magick-0.2.4 test/attachment_magick/units/image_test.rb