Commit 249e4891 authored by tmaruyama's avatar tmaruyama

add unit test of CustomField model before_validation

git-svn-id: https://svn.redmine.org/redmine/trunk@8190 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent c0e7be83
......@@ -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
......
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