diff options
author | Antonio Roberto <forevertonny@gmail.com> | 2011-12-16 17:17:14 -0200 |
---|---|---|
committer | Antonio Roberto <forevertonny@gmail.com> | 2011-12-16 17:17:14 -0200 |
commit | 66e747b461457b4f49d5b5d88334f5019bbfcc1e (patch) | |
tree | 59de1f17126e14e8b51a53c1edc1cbb6b20cc294 /activemodel/test | |
parent | f307f4d884be7d0dcef60df4636dbda7155b499d (diff) | |
download | rails-66e747b461457b4f49d5b5d88334f5019bbfcc1e.tar.gz rails-66e747b461457b4f49d5b5d88334f5019bbfcc1e.tar.bz2 rails-66e747b461457b4f49d5b5d88334f5019bbfcc1e.zip |
Fixed bug when error message is an empty string.
Diffstat (limited to 'activemodel/test')
-rw-r--r-- | activemodel/test/cases/validations/validates_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activemodel/test/cases/validations/validates_test.rb b/activemodel/test/cases/validations/validates_test.rb index 779f6c8448..ad3be4a3c1 100644 --- a/activemodel/test/cases/validations/validates_test.rb +++ b/activemodel/test/cases/validations/validates_test.rb @@ -16,6 +16,12 @@ class ValidatesTest < ActiveModel::TestCase PersonWithValidator.reset_callbacks(:validate) end + def test_validates_with_messages_empty + Person.validates :title, :presence => {:message => "" } + person = Person.new(:title => '') + assert !person.valid?, 'person should not be valid.' + end + def test_validates_with_built_in_validation Person.validates :title, :numericality => true person = Person.new |