@@ -20,7 +20,6 | |||||
20 | require File.expand_path('../../../test_helper', __FILE__) |
|
20 | require File.expand_path('../../../test_helper', __FILE__) | |
21 |
|
21 | |||
22 | class ApplicationHelperTest < ActionView::TestCase |
|
22 | class ApplicationHelperTest < ActionView::TestCase | |
23 | include Redmine::I18n |
|
|||
24 | include ERB::Util |
|
23 | include ERB::Util | |
25 | include Rails.application.routes.url_helpers |
|
24 | include Rails.application.routes.url_helpers | |
26 |
|
25 | |||
@@ -97,7 +96,7 class ApplicationHelperTest < ActionView::TestCase | |||||
97 | if 'ruby'.respond_to?(:encoding) |
|
96 | if 'ruby'.respond_to?(:encoding) | |
98 | def test_auto_links_with_non_ascii_characters |
|
97 | def test_auto_links_with_non_ascii_characters | |
99 | to_test = { |
|
98 | to_test = { | |
100 |
'http://foo.bar/ |
|
99 | 'http://foo.bar/тест' => '<a class="external" href="http://foo.bar/тест">http://foo.bar/тест</a>' | |
101 | } |
|
100 | } | |
102 | to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } |
|
101 | to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } | |
103 | end |
|
102 | end | |
@@ -251,7 +250,7 RAW | |||||
251 | if 'ruby'.respond_to?(:encoding) |
|
250 | if 'ruby'.respond_to?(:encoding) | |
252 | def test_textile_external_links_with_non_ascii_characters |
|
251 | def test_textile_external_links_with_non_ascii_characters | |
253 | to_test = { |
|
252 | to_test = { | |
254 |
'This is a "link":http://foo.bar/ |
|
253 | 'This is a "link":http://foo.bar/тест' => 'This is a <a href="http://foo.bar/тест" class="external">link</a>' | |
255 | } |
|
254 | } | |
256 | to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } |
|
255 | to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } | |
257 | end |
|
256 | end | |
@@ -597,7 +596,7 RAW | |||||
597 | '[[CookBook documentation#One-section]]' => '<a href="/projects/ecookbook/wiki/CookBook_documentation#One-section" class="wiki-page">CookBook documentation</a>', |
|
596 | '[[CookBook documentation#One-section]]' => '<a href="/projects/ecookbook/wiki/CookBook_documentation#One-section" class="wiki-page">CookBook documentation</a>', | |
598 | '[[Another page#anchor|Page]]' => '<a href="/projects/ecookbook/wiki/Another_page#anchor" class="wiki-page">Page</a>', |
|
597 | '[[Another page#anchor|Page]]' => '<a href="/projects/ecookbook/wiki/Another_page#anchor" class="wiki-page">Page</a>', | |
599 | # UTF8 anchor |
|
598 | # UTF8 anchor | |
600 |
'[[Another_page# |
|
599 | '[[Another_page#Тест|Тест]]' => %|<a href="/projects/ecookbook/wiki/Another_page##{CGI.escape 'Тест'}" class="wiki-page">Тест</a>|, | |
601 | # page that doesn't exist |
|
600 | # page that doesn't exist | |
602 | '[[Unknown page]]' => '<a href="/projects/ecookbook/wiki/Unknown_page" class="wiki-page new">Unknown page</a>', |
|
601 | '[[Unknown page]]' => '<a href="/projects/ecookbook/wiki/Unknown_page" class="wiki-page new">Unknown page</a>', | |
603 | '[[Unknown page|404]]' => '<a href="/projects/ecookbook/wiki/Unknown_page" class="wiki-page new">404</a>', |
|
602 | '[[Unknown page|404]]' => '<a href="/projects/ecookbook/wiki/Unknown_page" class="wiki-page new">404</a>', |
General Comments 0
You need to be logged in to leave comments.
Login now