diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-23 01:58:41 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-23 01:58:41 +0000 |
commit | 048dcf31c9215d4d48994e74631074a7399f5012 (patch) | |
tree | 78b5fe621c7350f8eeeae710c3dc73d5c7c3d8a9 | |
parent | c627590fd405bab67fce498cd2b6a781f99f261b (diff) | |
download | rails-048dcf31c9215d4d48994e74631074a7399f5012.tar.gz rails-048dcf31c9215d4d48994e74631074a7399f5012.tar.bz2 rails-048dcf31c9215d4d48994e74631074a7399f5012.zip |
Mock the beginning of the transaction also. References #8642.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7089 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb | 2 | ||||
-rw-r--r-- | activerecord/test/transactions_test.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb index 943aed98d8..e8f133848d 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb @@ -53,7 +53,7 @@ module ActiveRecord begin if block_given? if start_db_transaction - begin_db_transaction + begin_db_transaction transaction_open = true end yield diff --git a/activerecord/test/transactions_test.rb b/activerecord/test/transactions_test.rb index b253943eaa..a31d993dbb 100644 --- a/activerecord/test/transactions_test.rb +++ b/activerecord/test/transactions_test.rb @@ -167,6 +167,7 @@ class TransactionTest < Test::Unit::TestCase uses_mocha 'mocking connection.commit_db_transaction' do def test_rollback_when_commit_raises + Topic.connection.expects(:begin_db_transaction) Topic.connection.expects(:commit_db_transaction).raises('OH NOES') Topic.connection.expects(:rollback_db_transaction) |