aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/fixtures_test.rb
diff options
context:
space:
mode:
authorutilum <oz@utilum.com>2018-07-19 01:25:25 +0300
committerutilum <oz@utilum.com>2018-07-19 03:31:42 +0300
commitd0743d026345946792bd8531e1ae1380d794f686 (patch)
tree1f4542086a1494a94b82a23665e539bb1294cf2c /activerecord/test/cases/fixtures_test.rb
parent08813dd62a0ae4061774511dfc8a7fc0384d6528 (diff)
downloadrails-d0743d026345946792bd8531e1ae1380d794f686.tar.gz
rails-d0743d026345946792bd8531e1ae1380d794f686.tar.bz2
rails-d0743d026345946792bd8531e1ae1380d794f686.zip
Use MethodCallAssertions instead of Mocha#expects
Many calls to `Mocha#expects` preceded the introduction of `ActiveSupport::Testing::MethodCallAssertions` in 53f64c0fb, and many are simple to replace with `MethodCallAssertions`. This patch makes all these simple replacements. Step 5 in #33162
Diffstat (limited to 'activerecord/test/cases/fixtures_test.rb')
-rw-r--r--activerecord/test/cases/fixtures_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb
index cdc9a8585f..a0ab7a92ce 100644
--- a/activerecord/test/cases/fixtures_test.rb
+++ b/activerecord/test/cases/fixtures_test.rb
@@ -861,9 +861,9 @@ class TransactionalFixturesOnConnectionNotification < ActiveRecord::TestCase
def lock_thread=(lock_thread); end
end.new
- connection.expects(:begin_transaction).with(joinable: false)
-
- fire_connection_notification(connection)
+ assert_called_with(connection, :begin_transaction, [joinable: false]) do
+ fire_connection_notification(connection)
+ end
end
def test_notification_established_transactions_are_rolled_back
@@ -891,7 +891,7 @@ class TransactionalFixturesOnConnectionNotification < ActiveRecord::TestCase
private
def fire_connection_notification(connection)
- ActiveRecord::Base.connection_handler.stub(:retrieve_connection, connection) do
+ assert_called_with(ActiveRecord::Base.connection_handler, :retrieve_connection, ["book"], returns: connection) do
message_bus = ActiveSupport::Notifications.instrumenter
payload = {
spec_name: "book",