diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-01-29 21:09:44 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-01-29 21:09:44 +0000 |
commit | 8d5f932660f96367948fb89210f7a04d3fc90891 (patch) | |
tree | 9a145b22c3c932d61a3a073a105c0da48410956d /test | |
parent | cd6db6a3cbe43880eca4eec8c967fb78d95a2926 (diff) | |
download | redmine-8d5f932660f96367948fb89210f7a04d3fc90891.tar.gz redmine-8d5f932660f96367948fb89210f7a04d3fc90891.zip |
Do not validate blank default custom field value.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8722 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/custom_field_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/unit/custom_field_test.rb b/test/unit/custom_field_test.rb index 6cef44ea9..db7a637fd 100644 --- a/test/unit/custom_field_test.rb +++ b/test/unit/custom_field_test.rb @@ -52,6 +52,11 @@ class CustomFieldTest < ActiveSupport::TestCase assert field.valid? end + def test_default_value_should_not_be_validated_when_blank + field = CustomField.new(:name => 'Test', :field_format => 'list', :possible_values => ['a', 'b'], :is_required => true, :default_value => '') + assert field.valid? + end + def test_possible_values_should_accept_an_array field = CustomField.new field.possible_values = ["One value", ""] |