diff options
author | Josh Kalderimis <josh.kalderimis@gmail.com> | 2010-05-09 00:03:45 +0300 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-05-09 00:08:11 +0300 |
commit | 605c6455ac722ed9679e17458a47cc649cdedab0 (patch) | |
tree | 028c8922ebb81bc0209aeffcac22c2b1a49b8e66 /activemodel/test/cases/validations_test.rb | |
parent | 88ad3ed8b53a66954f50a423e138052d048a42c3 (diff) | |
download | rails-605c6455ac722ed9679e17458a47cc649cdedab0.tar.gz rails-605c6455ac722ed9679e17458a47cc649cdedab0.tar.bz2 rails-605c6455ac722ed9679e17458a47cc649cdedab0.zip |
removed AR from all AMo tests, including any unneeded files (schema, fixtures and test helper)
Diffstat (limited to 'activemodel/test/cases/validations_test.rb')
-rw-r--r-- | activemodel/test/cases/validations_test.rb | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/activemodel/test/cases/validations_test.rb b/activemodel/test/cases/validations_test.rb index 0594580804..578ffc27dd 100644 --- a/activemodel/test/cases/validations_test.rb +++ b/activemodel/test/cases/validations_test.rb @@ -1,13 +1,11 @@ # encoding: utf-8 require 'cases/helper' -require 'cases/tests_database' require 'models/topic' require 'models/reply' require 'models/custom_reader' class ValidationsTest < ActiveModel::TestCase - include ActiveModel::TestsDatabase def setup Topic._validators.clear @@ -166,15 +164,15 @@ class ValidationsTest < ActiveModel::TestCase t = Topic.new :title => '' assert t.invalid? - assert_equal :title, key = t.errors.keys.first - assert_equal "can't be blank", t.errors[key].first - assert_equal 'is too short (minimum is 2 characters)', t.errors[key].second - assert_equal :author_name, key = t.errors.keys.second - assert_equal "can't be blank", t.errors[key].first - assert_equal :author_email_address, key = t.errors.keys.third - assert_equal 'will never be valid', t.errors[key].first - assert_equal :content, key = t.errors.keys.fourth - assert_equal 'is too short (minimum is 2 characters)', t.errors[key].first + assert_equal :title, key = t.errors.keys[0] + assert_equal "can't be blank", t.errors[key][0] + assert_equal 'is too short (minimum is 2 characters)', t.errors[key][1] + assert_equal :author_name, key = t.errors.keys[1] + assert_equal "can't be blank", t.errors[key][0] + assert_equal :author_email_address, key = t.errors.keys[2] + assert_equal 'will never be valid', t.errors[key][0] + assert_equal :content, key = t.errors.keys[3] + assert_equal 'is too short (minimum is 2 characters)', t.errors[key][0] end def test_invalid_should_be_the_opposite_of_valid |