Skip to content
Browse files

Fixing tests for issue #99

  • Loading branch information...
1 parent 1ddad99 commit 5ff942ba500378f9c8f13e4b23c7d908c63c341f @smasry committed Feb 8, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 spec/database_cleaner/active_record/transaction_spec.rb
View
10 spec/database_cleaner/active_record/transaction_spec.rb
@@ -38,18 +38,19 @@ module ActiveRecord
describe "#clean" do
it "should start a transaction" do
- connection.should_receive(:open_transactions).and_return(1)
+ connection.should_receive(:open_transactions).and_return(1)
- connection.stub!(:decrement_open_transactions)
+ connection.stub!(:decrement_open_transactions)
- connection.should_receive(:rollback_db_transaction)
- Transaction.new.clean
+ connection.should_receive(:rollback_db_transaction)
+ Transaction.new.clean
end
it "should decrement open transactions if possible" do
connection.should_receive(:open_transactions).and_return(1)
connection.stub!(:respond_to?).with(:decrement_open_transactions).and_return(true)
+ connection.stub!(:respond_to?).with(:rollback_transaction_records).and_return(false)
connection.stub!(:rollback_db_transaction)
connection.should_receive(:decrement_open_transactions)
@@ -65,6 +66,7 @@ module ActiveRecord
it "should decrement connection via ActiveRecord::Base if connection won't" do
connection.should_receive(:open_transactions).and_return(1)
connection.stub!(:respond_to?).with(:decrement_open_transactions).and_return(false)
+ connection.stub!(:respond_to?).with(:rollback_transaction_records).and_return(false)
connection.stub!(:rollback_db_transaction)
::ActiveRecord::Base.should_receive(:decrement_open_transactions)

0 comments on commit 5ff942b

Please sign in to comment.
Something went wrong with that request. Please try again.