diff options
author | José Valim <jose.valim@gmail.com> | 2009-10-20 22:20:01 -0200 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2009-10-20 17:52:32 -0700 |
commit | e714b499cc1f7ebc84f8d0e96607b79e60f2828d (patch) | |
tree | a9725eb2101a56db366603ca849a3ed260b710d6 /activerecord/test/cases/validations_test.rb | |
parent | 4f6d6f7031a88b647814fc0154e6b69b636dc912 (diff) | |
download | rails-e714b499cc1f7ebc84f8d0e96607b79e60f2828d.tar.gz rails-e714b499cc1f7ebc84f8d0e96607b79e60f2828d.tar.bz2 rails-e714b499cc1f7ebc84f8d0e96607b79e60f2828d.zip |
Move validator, human_name and human_attribute_name to ActiveModel, remove deprecated error messages and add i18n_scope and lookup_ancestors.
Signed-off-by: Carl Lerche <carllerche@mac.com>
Diffstat (limited to 'activerecord/test/cases/validations_test.rb')
-rw-r--r-- | activerecord/test/cases/validations_test.rb | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/activerecord/test/cases/validations_test.rb b/activerecord/test/cases/validations_test.rb index 5cdb623eef..130231c622 100644 --- a/activerecord/test/cases/validations_test.rb +++ b/activerecord/test/cases/validations_test.rb @@ -148,40 +148,9 @@ class ValidationsTest < ActiveRecord::TestCase assert_equal "100,000", d.salary_before_type_cast end - def test_validates_length_with_globally_modified_error_message - defaults = ActiveSupport::Deprecation.silence { ActiveRecord::Errors.default_error_messages } - original_message = defaults[:too_short] - defaults[:too_short] = 'tu est trops petit hombre {{count}}' - - Topic.validates_length_of :title, :minimum => 10 - t = Topic.create(:title => 'too short') - assert !t.valid? - - assert_equal ['tu est trops petit hombre 10'], t.errors[:title] - - ensure - defaults[:too_short] = original_message - end - def test_validates_acceptance_of_as_database_column Topic.validates_acceptance_of(:author_name) topic = Topic.create("author_name" => "Dan Brown") assert_equal "Dan Brown", topic["author_name"] end - - def test_deprecated_validation_instance_methods - tom = DeprecatedPerson.new - - assert_deprecated do - assert tom.invalid? - assert_equal ["always invalid", "invalid on create"], tom.errors[:name] - end - - tom.save(false) - - assert_deprecated do - assert tom.invalid? - assert_equal ["always invalid", "invalid on update"], tom.errors[:name] - end - end end |