diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-05-31 17:03:40 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-05-31 17:03:40 -0700 |
commit | cb59c93de06421c4c7f04c8abefa1a0f69c91099 (patch) | |
tree | 997e7507afb4a4f1612e976200434beb530b13fa /activerecord/test | |
parent | f9db7695fe3c148c8d1077f1564e5b94d126b83b (diff) | |
parent | ef21e013338461f33bf85f5cf6edd84b5ce9b6fe (diff) | |
download | rails-cb59c93de06421c4c7f04c8abefa1a0f69c91099.tar.gz rails-cb59c93de06421c4c7f04c8abefa1a0f69c91099.tar.bz2 rails-cb59c93de06421c4c7f04c8abefa1a0f69c91099.zip |
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/cases/validations_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/validations_test.rb b/activerecord/test/cases/validations_test.rb index a4d9da4806..7b71647d25 100755 --- a/activerecord/test/cases/validations_test.rb +++ b/activerecord/test/cases/validations_test.rb @@ -583,6 +583,12 @@ class ValidationsTest < ActiveRecord::TestCase assert_nil t.errors.on(:title) end + def test_validate_format_with_formatted_message + Topic.validates_format_of(:title, :with => /^Valid Title$/, :message => "can't be %s") + t = Topic.create(:title => 'Invalid title') + assert_equal "can't be Invalid title", t.errors.on(:title) + end + def test_validates_inclusion_of Topic.validates_inclusion_of( :title, :in => %w( a b c d e f g ) ) |