From a4b03289d52dd11f0f7eb1cb632d7bc067e54523 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Fri, 21 Apr 2023 03:35:49 +0000 Subject: 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 --- test/unit/lib/redmine/field_format/field_format_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') 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 'foo bar', 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 'foo :bar', 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") -- cgit v1.2.3