diff options
author | Akshay Vishnoi <akshay.vishnoi@vinsol.com> | 2014-06-16 08:22:11 +0530 |
---|---|---|
committer | Akshay Vishnoi <akshay.vishnoi@vinsol.com> | 2014-06-16 08:22:11 +0530 |
commit | 73dc6d790c997b9ebb4a57b8e0b81b3f8efb8d04 (patch) | |
tree | 506efb8394a0d0327a8d2e7b71e2d59eba70b7a9 /activemodel | |
parent | 952d0f8bdfa3f919794bf36049bafd2d95e3c97b (diff) | |
download | rails-73dc6d790c997b9ebb4a57b8e0b81b3f8efb8d04.tar.gz rails-73dc6d790c997b9ebb4a57b8e0b81b3f8efb8d04.tar.bz2 rails-73dc6d790c997b9ebb4a57b8e0b81b3f8efb8d04.zip |
Correct typo, add test for validates_absence_of, correct method names
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/test/cases/validations/absence_validation_test.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activemodel/test/cases/validations/absence_validation_test.rb b/activemodel/test/cases/validations/absence_validation_test.rb index 795ce16d28..ebfe1cf4e4 100644 --- a/activemodel/test/cases/validations/absence_validation_test.rb +++ b/activemodel/test/cases/validations/absence_validation_test.rb @@ -11,7 +11,7 @@ class AbsenceValidationTest < ActiveModel::TestCase CustomReader.clear_validators! end - def test_validate_absences + def test_validates_absence_of Topic.validates_absence_of(:title, :content) t = Topic.new t.title = "foo" @@ -23,11 +23,12 @@ class AbsenceValidationTest < ActiveModel::TestCase t.content = "something" assert t.invalid? assert_equal ["must be blank"], t.errors[:content] + assert_equal [], t.errors[:title] t.content = "" assert t.valid? end - def test_accepts_array_arguments + def test_validates_absence_of_with_array_arguments Topic.validates_absence_of %w(title content) t = Topic.new t.title = "foo" @@ -37,7 +38,7 @@ class AbsenceValidationTest < ActiveModel::TestCase assert_equal ["must be blank"], t.errors[:content] end - def test_validates_acceptance_of_with_custom_error_using_quotes + def test_validates_absence_of_with_custom_error_using_quotes Person.validates_absence_of :karma, message: "This string contains 'single' and \"double\" quotes" p = Person.new p.karma = "good" |