aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/connection
diff options
context:
space:
mode:
Diffstat (limited to 'actioncable/test/connection')
-rw-r--r--actioncable/test/connection/client_socket_test.rb8
-rw-r--r--actioncable/test/connection/identifier_test.rb8
2 files changed, 12 insertions, 4 deletions
diff --git a/actioncable/test/connection/client_socket_test.rb b/actioncable/test/connection/client_socket_test.rb
index 5c31690c8b..da72501c8e 100644
--- a/actioncable/test/connection/client_socket_test.rb
+++ b/actioncable/test/connection/client_socket_test.rb
@@ -2,8 +2,11 @@
require "test_helper"
require "stubs/test_server"
+require "active_support/testing/method_call_assertions"
class ActionCable::Connection::ClientSocketTest < ActionCable::TestCase
+ include ActiveSupport::Testing::MethodCallAssertions
+
class Connection < ActionCable::Connection::Base
attr_reader :connected, :websocket, :errors
@@ -41,9 +44,10 @@ class ActionCable::Connection::ClientSocketTest < ActionCable::TestCase
# Internal hax = :(
client = connection.websocket.send(:websocket)
client.instance_variable_get("@stream").expects(:write).raises("foo")
- client.expects(:client_gone).never
- client.write("boo")
+ assert_not_called(client, :client_gone) do
+ client.write("boo")
+ end
assert_equal %w[ foo ], connection.errors
end
end
diff --git a/actioncable/test/connection/identifier_test.rb b/actioncable/test/connection/identifier_test.rb
index 6b6c8cd31a..f3bc6f99a4 100644
--- a/actioncable/test/connection/identifier_test.rb
+++ b/actioncable/test/connection/identifier_test.rb
@@ -1,10 +1,13 @@
# frozen_string_literal: true
require "test_helper"
+require "active_support/testing/method_call_assertions"
require "stubs/test_server"
require "stubs/user"
class ActionCable::Connection::IdentifierTest < ActionCable::TestCase
+ include ActiveSupport::Testing::MethodCallAssertions
+
class Connection < ActionCable::Connection::Base
identified_by :current_user
attr_reader :websocket
@@ -50,8 +53,9 @@ class ActionCable::Connection::IdentifierTest < ActionCable::TestCase
run_in_eventmachine do
open_connection_with_stubbed_pubsub
- @connection.websocket.expects(:close).never
- @connection.process_internal_message "type" => "unknown"
+ assert_not_called(@connection.websocket, :close) do
+ @connection.process_internal_message "type" => "unknown"
+ end
end
end