aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/channel/base_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actioncable/test/channel/base_test.rb')
-rw-r--r--actioncable/test/channel/base_test.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/actioncable/test/channel/base_test.rb b/actioncable/test/channel/base_test.rb
index 3b8eb63975..d368794f73 100644
--- a/actioncable/test/channel/base_test.rb
+++ b/actioncable/test/channel/base_test.rb
@@ -1,6 +1,7 @@
# frozen_string_literal: true
require "test_helper"
+require "minitest/mock"
require "stubs/test_connection"
require "stubs/room"
@@ -226,12 +227,13 @@ class ActionCable::Channel::BaseTest < ActiveSupport::TestCase
events << ActiveSupport::Notifications::Event.new(*args)
end
- @channel.stubs(:subscription_confirmation_sent?).returns(false)
- @channel.send(:transmit_subscription_confirmation)
+ @channel.stub(:subscription_confirmation_sent?, false) do
+ @channel.send(:transmit_subscription_confirmation)
- assert_equal 1, events.length
- assert_equal "transmit_subscription_confirmation.action_cable", events[0].name
- assert_equal "ActionCable::Channel::BaseTest::ChatChannel", events[0].payload[:channel_class]
+ assert_equal 1, events.length
+ assert_equal "transmit_subscription_confirmation.action_cable", events[0].name
+ assert_equal "ActionCable::Channel::BaseTest::ChatChannel", events[0].payload[:channel_class]
+ end
ensure
ActiveSupport::Notifications.unsubscribe "transmit_subscription_confirmation.action_cable"
end