diff options
author | Gonçalo Silva <goncalossilva@gmail.com> | 2011-03-24 17:21:17 +0000 |
---|---|---|
committer | Gonçalo Silva <goncalossilva@gmail.com> | 2011-03-24 17:21:17 +0000 |
commit | 9887f238871bb2dd73de6ce8855615bcc5d8d079 (patch) | |
tree | 74fa9ff9524a51701cfa23f708b3f777c65b7fe5 /activerecord/test/cases/validations_test.rb | |
parent | aff821508a16245ebc03510ba29c70379718dfb7 (diff) | |
parent | 5214e73850916de3c9127d35a4ecee0424d364a3 (diff) | |
download | rails-9887f238871bb2dd73de6ce8855615bcc5d8d079.tar.gz rails-9887f238871bb2dd73de6ce8855615bcc5d8d079.tar.bz2 rails-9887f238871bb2dd73de6ce8855615bcc5d8d079.zip |
Merge branch 'master' of https://github.com/rails/rails
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 |