diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-03-21 18:29:15 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-03-21 18:34:05 +0000 |
commit | 320933205e16164ff55245aef1e95fb06e609d06 (patch) | |
tree | 682db473d23e12a6a9b5c729e7bb67039f0e96be /activemodel/test/cases/validations | |
parent | 2bc4189faf1dc9ebc59054be0b54e15d098ab1f2 (diff) | |
download | rails-320933205e16164ff55245aef1e95fb06e609d06.tar.gz rails-320933205e16164ff55245aef1e95fb06e609d06.tar.bz2 rails-320933205e16164ff55245aef1e95fb06e609d06.zip |
Deprecate Errors#on_base/add_to_base/invalid?/each_full
Diffstat (limited to 'activemodel/test/cases/validations')
-rw-r--r-- | activemodel/test/cases/validations/conditional_validation_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/test/cases/validations/conditional_validation_test.rb b/activemodel/test/cases/validations/conditional_validation_test.rb index 72b4800dce..4c716d5d48 100644 --- a/activemodel/test/cases/validations/conditional_validation_test.rb +++ b/activemodel/test/cases/validations/conditional_validation_test.rb @@ -124,15 +124,15 @@ class ConditionalValidationTest < ActiveModel::TestCase Topic.validates_presence_of(:author_name, :if => "title.to_s.match('important')") t = Topic.new - assert !t.valid?, "A topic without a title should not be valid" - assert !t.errors.invalid?("author_name"), "A topic without an 'important' title should not require an author" + assert t.invalid?, "A topic without a title should not be valid" + assert t.errors[:author_name].empty?, "A topic without an 'important' title should not require an author" t.title = "Just a title" assert t.valid?, "A topic with a basic title should be valid" t.title = "A very important title" assert !t.valid?, "A topic with an important title, but without an author, should not be valid" - assert t.errors.invalid?("author_name"), "A topic with an 'important' title should require an author" + assert t.errors[:author_name].any?, "A topic with an 'important' title should require an author" t.author_name = "Hubert J. Farnsworth" assert t.valid?, "A topic with an important title and author should be valid" |