require File.expand_path('../../unit_test_helper', __FILE__)
class HashtagTest < Test::Unit::TestCase
def test_transform
result = auto_html("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vel ipsum et leo adipiscing ultrices. Etiam ac elementum cras amet. #LoremIpsum") { hashtag }
assert_equal 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vel ipsum et leo adipiscing ultrices. Etiam ac elementum cras amet. #LoremIpsum', result
end
def test_transform_with_multiple_hashtags
result = auto_html("Lorem ipsum #dolor sit amet, consectetur adipiscing elit. Donec vel ipsum et leo #adipiscingUltrices. Etiam ac elementum cras amet.") { hashtag }
assert_equal 'Lorem ipsum #dolor sit amet, consectetur adipiscing elit. Donec vel ipsum et leo #adipiscingUltrices. Etiam ac elementum cras amet.', result
end
def test_transform_with_twitter_source
result = auto_html("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vel ipsum et leo adipiscing ultrices. Etiam ac elementum cras amet. #LoremIpsum") { hashtag source: :twitter }
assert_equal 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vel ipsum et leo adipiscing ultrices. Etiam ac elementum cras amet. #LoremIpsum', result
end
def test_transform_with_facebook_source
result = auto_html("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vel ipsum et leo adipiscing ultrices. Etiam ac elementum cras amet. #LoremIpsum") { hashtag source: :facebook }
assert_equal 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vel ipsum et leo adipiscing ultrices. Etiam ac elementum cras amet. #LoremIpsum', result
end
end