@@ -498,6 +498,9 module Redmine | |||
|
498 | 498 | tag_id = nil |
|
499 | 499 | s << view.content_tag('label', tag + ' ' + label) |
|
500 | 500 | end |
|
501 | if custom_value.custom_field.multiple? | |
|
502 | s << view.hidden_field_tag(tag_name, '') | |
|
503 | end | |
|
501 | 504 | css = "#{options[:class]} check_box_group" |
|
502 | 505 | view.content_tag('span', s, options.merge(:class => css)) |
|
503 | 506 | end |
@@ -116,6 +116,18 class Redmine::ListFieldFormatTest < ActionView::TestCase | |||
|
116 | 116 | end |
|
117 | 117 | end |
|
118 | 118 | |
|
119 | def test_edit_tag_with_check_box_style_and_multiple_values_should_contain_hidden_field_to_clear_value | |
|
120 | field = IssueCustomField.new(:field_format => 'list', :possible_values => ['Foo', 'Bar'], :is_required => false, | |
|
121 | :edit_tag_style => 'check_box', :multiple => true) | |
|
122 | value = CustomFieldValue.new(:custom_field => field, :customized => Issue.new) | |
|
123 | ||
|
124 | tag = field.format.edit_tag(self, 'id', 'name', value) | |
|
125 | assert_select_in tag, 'span' do | |
|
126 | assert_select 'input[type=checkbox]', 2 | |
|
127 | assert_select 'input[type=hidden]', 1 | |
|
128 | end | |
|
129 | end | |
|
130 | ||
|
119 | 131 | def test_field_with_url_pattern_should_link_value |
|
120 | 132 | field = IssueCustomField.new(:field_format => 'list', :url_pattern => 'http://localhost/%value%') |
|
121 | 133 | formatted = field.format.formatted_value(self, field, 'foo', Issue.new, true) |
General Comments 0
You need to be logged in to leave comments.
Login now