mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix transaction exception test
This commit is contained in:
parent
039d78a7d8
commit
f54be2cb31
1 changed files with 1 additions and 0 deletions
|
@ -216,6 +216,7 @@ class TransactionTest < ActiveRecord::TestCase
|
|||
uses_mocha 'mocking connection.commit_db_transaction' do
|
||||
def test_rollback_when_commit_raises
|
||||
Topic.connection.expects(:begin_db_transaction)
|
||||
Topic.connection.expects(:transaction_active?).returns(true) if current_adapter?(:PostgreSQLAdapter)
|
||||
Topic.connection.expects(:commit_db_transaction).raises('OH NOES')
|
||||
Topic.connection.expects(:rollback_db_transaction)
|
||||
|
||||
|
|
Loading…
Reference in a new issue