Permalink
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...
1 parent c627590 commit 048dcf31c9215d4d48994e74631074a7399f5012 @jeremy jeremy committed Jun 23, 2007
@@ -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
@@ -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)

0 comments on commit 048dcf3

Please sign in to comment.