Feature #2464 » 2464.patch
lib/redmine/views/labelled_form_builder.rb | ||
---|---|---|
49 | 49 |
# display the value before type cast when the entered value is not valid |
50 | 50 |
if @object.errors[field].blank? |
51 | 51 |
options = options.merge(:value => format_hours(@object.send field)) |
52 |
.with_defaults(:placeholder => 'h:mm') |
|
52 | 53 |
end |
53 | 54 |
text_field field, options |
54 | 55 |
end |
test/unit/lib/redmine/views/labelled_form_builder_test.rb | ||
---|---|---|
35 | 35 |
entry.validate |
36 | 36 | |
37 | 37 |
labelled_form_for(entry) do |f| |
38 |
assert_include 'value="2:30"', f.hours_field(:hours) |
|
38 |
field_html = f.hours_field(:hours) |
|
39 |
assert_include 'value="2:30"', field_html |
|
40 |
assert_include 'placeholder="h:mm"', field_html |
|
39 | 41 |
end |
40 | 42 |
end |
41 | 43 |
- « Previous
- 1
- 2
- Next »