diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2010-09-05 21:20:54 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-06 13:39:55 +0200 |
commit | 9b610049bb4f73dbcdc670879683ec2a1a2ab780 (patch) | |
tree | f93f129985ed38eb8bd578ca52d16aae21192377 /activerecord/test/cases/validations_test.rb | |
parent | a18b73b43c07d031c9a660bc119835dcb6db85cf (diff) | |
download | rails-9b610049bb4f73dbcdc670879683ec2a1a2ab780.tar.gz rails-9b610049bb4f73dbcdc670879683ec2a1a2ab780.tar.bz2 rails-9b610049bb4f73dbcdc670879683ec2a1a2ab780.zip |
Cleanup deprecation warnings in active record
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test/cases/validations_test.rb')
-rw-r--r-- | activerecord/test/cases/validations_test.rb | 43 |
1 files changed, 0 insertions, 43 deletions
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 |