summaryrefslogtreecommitdiffstats
path: root/test/unit/custom_field_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-12-11 12:04:16 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-12-11 12:04:16 +0000
commit4f8ed70813772a803948a156381e8f71cd1bd3af (patch)
tree87a89287b6aa852b544b80512155bf8d47a44ec2 /test/unit/custom_field_test.rb
parent0471de41ff4828345ca0afa393f4b8f3bf0098d2 (diff)
downloadredmine-4f8ed70813772a803948a156381e8f71cd1bd3af.tar.gz
redmine-4f8ed70813772a803948a156381e8f71cd1bd3af.zip
add unit test of CustomField model before_validation
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8190 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/custom_field_test.rb')
-rw-r--r--test/unit/custom_field_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/custom_field_test.rb b/test/unit/custom_field_test.rb
index f3564e383..8b075cba8 100644
--- a/test/unit/custom_field_test.rb
+++ b/test/unit/custom_field_test.rb
@@ -25,6 +25,16 @@ class CustomFieldTest < ActiveSupport::TestCase
assert field.save
end
+ def test_before_validation
+ field = CustomField.new(:name => 'test_before_validation', :field_format => 'int')
+ field.searchable = true
+ assert field.save
+ assert_equal false, field.searchable
+ field.searchable = true
+ assert field.save
+ assert_equal false, field.searchable
+ end
+
def test_regexp_validation
field = IssueCustomField.new(:name => 'regexp', :field_format => 'text', :regexp => '[a-z0-9')
assert !field.save