aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test
diff options
context:
space:
mode:
authorutilum <oz@utilum.com>2018-04-22 13:31:43 +0200
committerutilum <oz@utilum.com>2018-04-26 08:02:08 +0200
commite4e25cc8dc76f641a304251ba37e1db99713e584 (patch)
tree9984a9ba7b4f594e52f39e9e971025f450e982c0 /actioncable/test
parent1a1650a012f03b62f0b19a58d3cdfa536cf9c4b7 (diff)
downloadrails-e4e25cc8dc76f641a304251ba37e1db99713e584.tar.gz
rails-e4e25cc8dc76f641a304251ba37e1db99713e584.tar.bz2
rails-e4e25cc8dc76f641a304251ba37e1db99713e584.zip
assert_not_called
Diffstat (limited to 'actioncable/test')
-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