aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/validations_test.rb
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-08-28 20:44:51 +0000
committerMichael Koziarski <michael@koziarski.com>2007-08-28 20:44:51 +0000
commit016947ceedfb43a864ea4ef57d97366ab2825785 (patch)
tree02e8242fe83ace2928604b03488cb3f961d8c15e /activerecord/test/validations_test.rb
parent5f163d256c718596d5848d60e7cf8c400f622bb7 (diff)
downloadrails-016947ceedfb43a864ea4ef57d97366ab2825785.tar.gz
rails-016947ceedfb43a864ea4ef57d97366ab2825785.tar.bz2
rails-016947ceedfb43a864ea4ef57d97366ab2825785.zip
Make sure create! raises errors on validation when creating multiple records. [hasmanyjosh] Closes #8952
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7361 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/validations_test.rb')
-rwxr-xr-xactiverecord/test/validations_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/validations_test.rb b/activerecord/test/validations_test.rb
index 19bca29fd8..847e11a747 100755
--- a/activerecord/test/validations_test.rb
+++ b/activerecord/test/validations_test.rb
@@ -95,6 +95,12 @@ class ValidationsTest < Test::Unit::TestCase
end
end
+ def test_exception_on_create_bang_many
+ assert_raises(ActiveRecord::RecordInvalid) do
+ Reply.create!([ { "title" => "OK" }, { "title" => "Wrong Create" }])
+ end
+ end
+
def test_scoped_create_without_attributes
Reply.with_scope(:create => {}) do
assert_raises(ActiveRecord::RecordInvalid) { Reply.create! }