diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-10-01 17:45:40 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-10-01 17:45:40 +0000 |
commit | 47e7ceacd72d9d9e022c118d069d6934563e1f74 (patch) | |
tree | 33b6e0ad35d0983892924c1d2cf928d1c532fc3a /test/unit/helpers/application_helper_test.rb | |
parent | 48fb20f5407ce8905755d91149dc7f8c7915c6d0 (diff) | |
download | redmine-47e7ceacd72d9d9e022c118d069d6934563e1f74.tar.gz redmine-47e7ceacd72d9d9e022c118d069d6934563e1f74.zip |
Better handling of external link style assignment.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@792 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/helpers/application_helper_test.rb')
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 24935bbb7..1da25b6fe 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -28,12 +28,12 @@ class ApplicationHelperTest < HelperTestCase def test_auto_links to_test = { - 'http://foo.bar' => '<a href="http://foo.bar">http://foo.bar</a>', - 'http://foo.bar.' => '<a href="http://foo.bar">http://foo.bar</a>.', - 'http://foo.bar/foo.bar#foo.bar.' => '<a href="http://foo.bar/foo.bar#foo.bar">http://foo.bar/foo.bar#foo.bar</a>.', - 'www.foo.bar' => '<a href="http://www.foo.bar">www.foo.bar</a>', - 'http://foo.bar/page?p=1&t=z&s=' => '<a href="http://foo.bar/page?p=1&t=z&s=">http://foo.bar/page?p=1&t=z&s=</a>', - 'http://foo.bar/page#125' => '<a href="http://foo.bar/page#125">http://foo.bar/page#125</a>' + 'http://foo.bar' => '<a class="external" href="http://foo.bar">http://foo.bar</a>', + 'http://foo.bar.' => '<a class="external" href="http://foo.bar">http://foo.bar</a>.', + 'http://foo.bar/foo.bar#foo.bar.' => '<a class="external" href="http://foo.bar/foo.bar#foo.bar">http://foo.bar/foo.bar#foo.bar</a>.', + 'www.foo.bar' => '<a class="external" href="http://www.foo.bar">www.foo.bar</a>', + 'http://foo.bar/page?p=1&t=z&s=' => '<a class="external" href="http://foo.bar/page?p=1&t=z&s=">http://foo.bar/page?p=1&t=z&s=</a>', + 'http://foo.bar/page#125' => '<a class="external" href="http://foo.bar/page#125">http://foo.bar/page#125</a>' } to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } end @@ -49,8 +49,9 @@ class ApplicationHelperTest < HelperTestCase '!http://foo.bar/image.jpg!' => '<img src="http://foo.bar/image.jpg" alt="" />', 'floating !>http://foo.bar/image.jpg!' => 'floating <div style="float:right"><img src="http://foo.bar/image.jpg" alt="" /></div>', # textile links - 'This is a "link":http://foo.bar' => 'This is a <a href="http://foo.bar">link</a>', - '"link (Link title)":http://foo.bar' => '<a href="http://foo.bar" title="Link title">link</a>' + 'This is a "link":http://foo.bar' => 'This is a <a href="http://foo.bar" class="external">link</a>', + 'This is an intern "link":/foo/bar' => 'This is an intern <a href="/foo/bar">link</a>', + '"link (Link title)":http://foo.bar' => '<a href="http://foo.bar" title="Link title" class="external">link</a>' } to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } end |