diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-06 14:11:26 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-06 14:11:26 +0000 |
commit | d2fefbe908db879745df854787653113a6bcbfac (patch) | |
tree | dd4581573e09e94c661a7183f31abdb024a311c6 /activerecord/test/base_test.rb | |
parent | fd9967bca2aa32dd4173881c4d8c55f5ebabe97e (diff) | |
download | rails-d2fefbe908db879745df854787653113a6bcbfac.tar.gz rails-d2fefbe908db879745df854787653113a6bcbfac.tar.bz2 rails-d2fefbe908db879745df854787653113a6bcbfac.zip |
Added MultiparameterAssignmentErrors and AttributeAssignmentError exceptions #777 [demetrius]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@853 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/base_test.rb')
-rwxr-xr-x | activerecord/test/base_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index 2a704424b1..71641601db 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -216,6 +216,16 @@ class BasicsTest < Test::Unit::TestCase assert_equal("initialized from attributes", topic.title) end + def test_initialize_with_invalid_attribute + begin + topic = Topic.new({ "title" => "test", + "last_read(1i)" => "2005", "last_read(2i)" => "2", "last_read(3i)" => "31"}) + rescue ActiveRecord::MultiparameterAssignmentErrors => ex + assert_equal(1, ex.errors.size) + assert_equal("last_read", ex.errors[0].attribute) + end + end + def test_load topics = Topic.find_all nil, "id" assert_equal(2, topics.size) |