summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
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")