diff options
author | José Valim <jose.valim@gmail.com> | 2010-08-29 20:45:34 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-08-29 20:45:34 -0300 |
commit | f0ee4a6002d4f7e27fb472051778eed8c4a3b47e (patch) | |
tree | 09ddff6e590efb7d2ca9ca81fbb10ffc9d593367 /activemodel/test | |
parent | 972efa11fd3339117e9f874beb4e85b146212c29 (diff) | |
download | rails-f0ee4a6002d4f7e27fb472051778eed8c4a3b47e.tar.gz rails-f0ee4a6002d4f7e27fb472051778eed8c4a3b47e.tar.bz2 rails-f0ee4a6002d4f7e27fb472051778eed8c4a3b47e.zip |
Remove deprecations in ActiveModel.
Diffstat (limited to 'activemodel/test')
-rw-r--r-- | activemodel/test/cases/validations_test.rb | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/activemodel/test/cases/validations_test.rb b/activemodel/test/cases/validations_test.rb index 1eed0b0c4d..4024002aaa 100644 --- a/activemodel/test/cases/validations_test.rb +++ b/activemodel/test/cases/validations_test.rb @@ -215,42 +215,6 @@ class ValidationsTest < ActiveModel::TestCase assert !t.invalid? end - def test_deprecated_error_messages_on - Topic.validates_presence_of :title - - t = Topic.new - assert t.invalid? - - [:title, "title"].each do |attribute| - assert_deprecated { assert_equal "can't be blank", t.errors.on(attribute) } - end - - Topic.validates_each(:title) do |record, attribute| - record.errors[attribute] << "invalid" - end - - assert t.invalid? - - [:title, "title"].each do |attribute| - assert_deprecated do - assert t.errors.on(attribute).include?("invalid") - assert t.errors.on(attribute).include?("can't be blank") - end - end - end - - def test_deprecated_errors_on_base_and_each - t = Topic.new - assert t.valid? - - assert_deprecated { t.errors.add_to_base "invalid topic" } - assert_deprecated { assert_equal "invalid topic", t.errors.on_base } - assert_deprecated { assert t.errors.invalid?(:base) } - - all_errors = t.errors.to_a - assert_deprecated { assert_equal all_errors, t.errors.each_full{|err| err} } - end - def test_validation_with_message_as_proc Topic.validates_presence_of(:title, :message => proc { "no blanks here".upcase }) |