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 %'', @artist_image.source_to_html
assert_equal 'http://b.vimeocdn.com/ts/819/560/81956031_640.jpg', @artist_image.source_to_image
assert_equal %'', @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 %'', @artist_image.source_to_html
assert_equal 'http://i1.ytimg.com/vi/FUe83k3t_0s/default.jpg', @artist_image.source_to_image
assert_equal %'', @place_image.source_to_html
assert_equal 'http://i1.ytimg.com/vi/FUe83k3t_0s/default.jpg', @place_image.source_to_image
end
end