diff options
Diffstat (limited to 'activerecord/test/validations_test.rb')
-rwxr-xr-x | activerecord/test/validations_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/validations_test.rb b/activerecord/test/validations_test.rb index 03d5da4990..263aba7747 100755 --- a/activerecord/test/validations_test.rb +++ b/activerecord/test/validations_test.rb @@ -25,6 +25,10 @@ class UniqueReply < Reply validates_uniqueness_of :content, :scope => 'parent_id' end +class PlagiarizedReply < Reply + validates_acceptance_of :author_name +end + class SillyUniqueReply < UniqueReply end @@ -292,6 +296,11 @@ class ValidationsTest < Test::Unit::TestCase assert t.save end + def test_validates_acceptance_of_as_database_column + reply = PlagiarizedReply.create("author_name" => "Dan Brown") + assert_equal "Dan Brown", reply["author_name"] + end + def test_validate_presences Topic.validates_presence_of(:title, :content) |