diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-18 01:25:39 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-18 01:25:39 +0000 |
commit | fb3fc46cddfe5d1a5f8a4cfb10aac94a11b4c77d (patch) | |
tree | e9e3349451ebd3b9ae73fc47a933ee5694515140 /actionpack/test | |
parent | 173544f56cb3cbdd5866a864ce3e287c8c86ce1e (diff) | |
download | rails-fb3fc46cddfe5d1a5f8a4cfb10aac94a11b4c77d.tar.gz rails-fb3fc46cddfe5d1a5f8a4cfb10aac94a11b4c77d.tar.bz2 rails-fb3fc46cddfe5d1a5f8a4cfb10aac94a11b4c77d.zip |
Correct length for the truncate text helper. Closes #2913.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3080 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/text_helper_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index d43bc43b9c..5bfe0709d9 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -24,7 +24,7 @@ class TextHelperTest < Test::Unit::TestCase def test_truncate assert_equal "Hello World!", truncate("Hello World!", 12) - assert_equal "Hello Worl...", truncate("Hello World!!", 12) + assert_equal "Hello Wor...", truncate("Hello World!!", 12) end def test_truncate_multibyte_without_kcode @@ -34,7 +34,7 @@ class TextHelperTest < Test::Unit::TestCase truncate("\354\225\210\353\205\225\355\225\230\354\204\270\354\232\224", 10) CODE - assert_equal "\354\225\210\353\205\225\355\225...", result + assert_equal "\354\225\210\353\205\225\355...", result end def test_truncate_multibyte_with_kcode @@ -47,7 +47,7 @@ class TextHelperTest < Test::Unit::TestCase truncate("\354\225\204\353\246\254\353\236\221 \354\225\204\353\246\254\353\236 \354\225\204\353\235\274\353\246\254\354\230\244", 10) CODE - assert_equal "\354\225\204\353\246\254\353\236\221 \354\225\204\353\246\254\353\236 \354\225\204...", result + assert_equal "\354\225\204\353\246\254\353\236\221 \354\225\204\353\246\254\353\236 ...", result end def test_strip_links @@ -165,7 +165,7 @@ class TextHelperTest < Test::Unit::TestCase url = "http://api.rubyonrails.com/Foo.html" email = "fantabulous@shiznadel.ic" - assert_equal %(<p><a href="#{url}">#{url[0..7]}...</a><br /><a href="mailto:#{email}">#{email[0..7]}...</a><br /></p>), auto_link("<p>#{url}<br />#{email}<br /></p>") { |url| truncate(url, 10) } + assert_equal %(<p><a href="#{url}">#{url[0...7]}...</a><br /><a href="mailto:#{email}">#{email[0...7]}...</a><br /></p>), auto_link("<p>#{url}<br />#{email}<br /></p>") { |url| truncate(url, 10) } end def test_sanitize_form |