Defect #27881 ยป fix-27881.diff
| app/models/issue.rb (working copy) | ||
|---|---|---|
|
end
|
||
|
def estimated_hours=(h)
|
||
|
write_attribute :estimated_hours, (h.is_a?(String) ? h.to_hours : h)
|
||
|
write_attribute :estimated_hours, (h.is_a?(String) ? (h.to_hours || h) : h)
|
||
|
end
|
||
|
safe_attributes 'project_id',
|
||
| test/unit/issue_test.rb (working copy) | ||
|---|---|---|
|
def test_estimated_hours_should_be_validated
|
||
|
set_language_if_valid 'en'
|
||
|
['-2'].each do |invalid|
|
||
|
['-2', '123abc'].each do |invalid|
|
||
|
issue = Issue.new(:estimated_hours => invalid)
|
||
|
assert !issue.valid?
|
||
|
assert_include 'Estimated time is invalid', issue.errors.full_messages
|
||