summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-04-21 03:35:49 +0000
committerGo MAEDA <maeda@farend.jp>2023-04-21 03:35:49 +0000
commita4b03289d52dd11f0f7eb1cb632d7bc067e54523 (patch)
tree4a6c4f9510a608972fd21cd1460f54c627f791ee /test
parentdad8d7f2b37c562af507fd18eac74644658c1c52 (diff)
downloadredmine-a4b03289d52dd11f0f7eb1cb632d7bc067e54523.tar.gz
redmine-a4b03289d52dd11f0f7eb1cb632d7bc067e54523.zip
Merged r22205 from trunk to 5.0-stable (#38464).
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@22206 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/lib/redmine/field_format/field_format_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/field_format/field_format_test.rb b/test/unit/lib/redmine/field_format/field_format_test.rb
index 7cc837fc9..d83d68655 100644
--- a/test/unit/lib/redmine/field_format/field_format_test.rb
+++ b/test/unit/lib/redmine/field_format/field_format_test.rb
@@ -90,6 +90,14 @@ class Redmine::FieldFormatTest < ActionView::TestCase
assert_equal '<a class="external" href="http://foo/foo%20bar">foo bar</a>', field.format.formatted_custom_value(self, custom_value, true)
end
+ def test_text_field_with_url_pattern_and_value_containing_a_colon_preceded_by_a_space_should_format_as_link
+ field = IssueCustomField.new(:field_format => 'string', :url_pattern => 'http://foo/%value%')
+ custom_value = CustomValue.new(:custom_field => field, :customized => Issue.new, :value => 'foo :bar')
+
+ assert_equal 'foo :bar', field.format.formatted_custom_value(self, custom_value, false)
+ assert_equal '<a class="external" href="http://foo/foo%20:bar">foo :bar</a>', field.format.formatted_custom_value(self, custom_value, true)
+ end
+
def test_text_field_with_url_pattern_should_not_encode_url_pattern
field = IssueCustomField.new(:field_format => 'string', :url_pattern => 'http://foo/bar#anchor')
custom_value = CustomValue.new(:custom_field => field, :customized => Issue.new, :value => "1")