@@ -29,7 +29,7 class Redmine::LinkFieldFormatTest < ActionView::TestCase | |||||
29 | assert_equal '<a href="http://foo/bar">bar</a>', field.format.formatted_custom_value(self, custom_value, true) |
|
29 | assert_equal '<a href="http://foo/bar">bar</a>', field.format.formatted_custom_value(self, custom_value, true) | |
30 | end |
|
30 | end | |
31 |
|
31 | |||
32 | def test_link_field_should_substitue_object_id_in_url |
|
32 | def test_link_field_should_substitute_object_id_in_url | |
33 | object = Issue.new |
|
33 | object = Issue.new | |
34 | object.stubs(:id).returns(10) |
|
34 | object.stubs(:id).returns(10) | |
35 |
|
35 | |||
@@ -40,7 +40,7 class Redmine::LinkFieldFormatTest < ActionView::TestCase | |||||
40 | assert_equal '<a href="http://foo/10">bar</a>', field.format.formatted_custom_value(self, custom_value, true) |
|
40 | assert_equal '<a href="http://foo/10">bar</a>', field.format.formatted_custom_value(self, custom_value, true) | |
41 | end |
|
41 | end | |
42 |
|
42 | |||
43 | def test_link_field_should_substitue_project_id_in_url |
|
43 | def test_link_field_should_substitute_project_id_in_url | |
44 | project = Project.new |
|
44 | project = Project.new | |
45 | project.stubs(:id).returns(52) |
|
45 | project.stubs(:id).returns(52) | |
46 | object = Issue.new |
|
46 | object = Issue.new | |
@@ -53,7 +53,7 class Redmine::LinkFieldFormatTest < ActionView::TestCase | |||||
53 | assert_equal '<a href="http://foo/52">bar</a>', field.format.formatted_custom_value(self, custom_value, true) |
|
53 | assert_equal '<a href="http://foo/52">bar</a>', field.format.formatted_custom_value(self, custom_value, true) | |
54 | end |
|
54 | end | |
55 |
|
55 | |||
56 | def test_link_field_should_substitue_regexp_groups |
|
56 | def test_link_field_should_substitute_regexp_groups | |
57 | field = IssueCustomField.new(:field_format => 'link', :regexp => /^(.+)-(.+)$/, :url_pattern => 'http://foo/%m2%/%m1%') |
|
57 | field = IssueCustomField.new(:field_format => 'link', :regexp => /^(.+)-(.+)$/, :url_pattern => 'http://foo/%m2%/%m1%') | |
58 | custom_value = CustomValue.new(:custom_field => field, :customized => Issue.new, :value => "56-142") |
|
58 | custom_value = CustomValue.new(:custom_field => field, :customized => Issue.new, :value => "56-142") | |
59 |
|
59 |
General Comments 0
You need to be logged in to leave comments.
Login now