Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 048dcf31c9215d4d48994e74631074a7399f5012 1 parent c627590
@jeremy jeremy authored
View
2  activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -53,7 +53,7 @@ def transaction(start_db_transaction = true)
begin
if block_given?
if start_db_transaction
- begin_db_transaction
+ begin_db_transaction
transaction_open = true
end
yield
View
1  activerecord/test/transactions_test.rb
@@ -167,6 +167,7 @@ def test_manually_rolling_back_a_transaction
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)
Please sign in to comment.
Something went wrong with that request. Please try again.