From 9b610049bb4f73dbcdc670879683ec2a1a2ab780 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sun, 5 Sep 2010 21:20:54 -0300 Subject: Cleanup deprecation warnings in active record MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activerecord/test/cases/validations_test.rb | 43 ----------------------------- 1 file changed, 43 deletions(-) (limited to 'activerecord/test/cases/validations_test.rb') diff --git a/activerecord/test/cases/validations_test.rb b/activerecord/test/cases/validations_test.rb index fd771ef4be..c3e494866b 100644 --- a/activerecord/test/cases/validations_test.rb +++ b/activerecord/test/cases/validations_test.rb @@ -13,24 +13,6 @@ class ProtectedPerson < ActiveRecord::Base attr_protected :first_name end -class DeprecatedPerson < ActiveRecord::Base - set_table_name 'people' - - private - - def validate - errors[:name] << "always invalid" - end - - def validate_on_create - errors[:name] << "invalid on create" - end - - def validate_on_update - errors[:name] << "invalid on update" - end -end - class ValidationsTest < ActiveRecord::TestCase fixtures :topics, :developers @@ -141,14 +123,6 @@ class ValidationsTest < ActiveRecord::TestCase assert reply.save(:validate => false) end - def test_deprecated_create_without_validation - reply = WrongReply.new - assert !reply.save - assert_deprecated do - assert reply.save(false) - end - end - def test_validates_acceptance_of_with_non_existant_table Object.const_set :IncorporealModel, Class.new(ActiveRecord::Base) @@ -170,23 +144,6 @@ class ValidationsTest < ActiveRecord::TestCase assert topic["approved"] end - def test_validate_is_deprecated_on_create - p = DeprecatedPerson.new - assert_deprecated do - assert !p.valid? - end - assert_equal ["always invalid", "invalid on create"], p.errors[:name] - end - - def test_validate_is_deprecated_on_update - p = DeprecatedPerson.new(:first_name => "David") - assert p.save(:validate => false) - assert_deprecated do - assert !p.valid? - end - assert_equal ["always invalid", "invalid on update"], p.errors[:name] - end - def test_validators assert_equal 1, Parrot.validators.size assert_equal 1, Company.validators.size -- cgit v1.2.3