Commit 4d160c6a authored by jplang's avatar jplang
Browse files

Fixed that issue validation fails if % done field is deactivated (#19731).

git-svn-id: https://svn.redmine.org/redmine/trunk@14241 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent e859855b
...@@ -1601,6 +1601,7 @@ class Issue < ActiveRecord::Base ...@@ -1601,6 +1601,7 @@ class Issue < ActiveRecord::Base
tracker.disabled_core_fields.each do |attribute| tracker.disabled_core_fields.each do |attribute|
send "#{attribute}=", nil send "#{attribute}=", nil
end end
self.done_ratio ||= 0
end end
end end
end end
...@@ -70,6 +70,15 @@ class IssueTest < ActiveSupport::TestCase ...@@ -70,6 +70,15 @@ class IssueTest < ActiveSupport::TestCase
assert_nil issue.estimated_hours assert_nil issue.estimated_hours
end end
def test_create_with_all_fields_disabled
tracker = Tracker.find(1)
tracker.core_fields = []
tracker.save!
issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3, :subject => 'test_create_with_all_fields_disabled')
assert_save issue
end
def test_start_date_format_should_be_validated def test_start_date_format_should_be_validated
set_language_if_valid 'en' set_language_if_valid 'en'
['2012', 'ABC', '2012-15-20'].each do |invalid_date| ['2012', 'ABC', '2012-15-20'].each do |invalid_date|
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment