From 5b983f6f6b92846a0f96757b0dc9e99e3d980df0 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 9 Dec 2004 15:06:24 +0000 Subject: Fixed Base.errors to be indifferent as to whether strings or symbols are used. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@98 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/validations_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/validations_test.rb b/activerecord/test/validations_test.rb index c396d30630..8e25453fae 100755 --- a/activerecord/test/validations_test.rb +++ b/activerecord/test/validations_test.rb @@ -138,10 +138,25 @@ class ValidationsTest < Test::Unit::TestCase t = Topic.create("title" => "We should be confirmed") assert !t.save + assert_equal "must be accepted", t.errors.on(:terms_of_service) t.terms_of_service = "1" assert t.save Topic.write_inheritable_attribute("validate_on_create", []) end + + + def test_eula + Topic.validate_acceptance(:eula, "must be abided") + + t = Topic.create("title" => "We should be confirmed") + assert !t.save + assert_equal "must be abided", t.errors.on(:eula) + + t.eula = "1" + assert t.save + + Topic.write_inheritable_attribute("validate_on_create", []) + end end \ No newline at end of file -- cgit v1.2.3