Sha256: 359f0576e1d70bee89f813952d6bb140a29bfccf2097b51a079fdf9bdad62b14

Contents?: true

Size: 838 Bytes

Versions: 2

Compression:

Stored size: 838 Bytes

Contents

require File.dirname(__FILE__) + '/../unit_test_helper'

class LinkTest < Test::Unit::TestCase

  def test_transform
    result = auto_html("http://vukajlija.com") { link }
    assert_equal '<a href="http://vukajlija.com">http://vukajlija.com</a>', result
  end
  
  def test_transform_complex_url
    result = auto_html("http://www.google.com/#q=nikola+tesla&ct=tesla09&oi=ddle&fp=Xmf0jJ9P_V0") { link }
    assert_equal '<a href="http://www.google.com/#q=nikola+tesla&ct=tesla09&oi=ddle&fp=Xmf0jJ9P_V0">http://www.google.com/#q=nikola+tesla&ct=tesla09&oi=ddle&fp=Xmf0jJ9P_V0</a>', result
  end
  
  def test_transform_with_options
    result = auto_html("http://rors.org") { link :rel => "nofollow", :target => "_blank" }
    assert_equal '<a href="http://rors.org" rel="nofollow" target="_blank">http://rors.org</a>', result
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dejan-auto_html-1.1.0 test/unit/filters/link_test.rb
dejan-auto_html-1.1.1 test/unit/filters/link_test.rb