mirror of
https://github.com/redmine/redmine.git
synced 2026-08-29 12:56:58 +02:00
Merged r22205 from trunk to 4.2-stable (#38464).
git-svn-id: https://svn.redmine.org/redmine/branches/4.2-stable@22207 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -86,6 +86,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")
|
||||
|
||||
Reference in New Issue
Block a user