diff options
Diffstat (limited to 'actioncable/test')
-rw-r--r-- | actioncable/test/connection/authorization_test.rb | 7 | ||||
-rw-r--r-- | actioncable/test/connection/base_test.rb | 2 | ||||
-rw-r--r-- | actioncable/test/connection/client_socket_test.rb | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/actioncable/test/connection/authorization_test.rb b/actioncable/test/connection/authorization_test.rb index f77e543435..ac5c128135 100644 --- a/actioncable/test/connection/authorization_test.rb +++ b/actioncable/test/connection/authorization_test.rb @@ -25,8 +25,11 @@ class ActionCable::Connection::AuthorizationTest < ActionCable::TestCase "HTTP_HOST" => "localhost", "HTTP_ORIGIN" => "http://rubyonrails.com" connection = Connection.new(server, env) - assert_called(connection.websocket, :close) do - connection.process + + assert_called_with(connection.websocket, :transmit, [{ type: "disconnect", reason: "unauthorized", reconnect: false }.to_json]) do + assert_called(connection.websocket, :close) do + connection.process + end end end end diff --git a/actioncable/test/connection/base_test.rb b/actioncable/test/connection/base_test.rb index 6ffa0961bc..299879ad4c 100644 --- a/actioncable/test/connection/base_test.rb +++ b/actioncable/test/connection/base_test.rb @@ -108,7 +108,7 @@ class ActionCable::Connection::BaseTest < ActionCable::TestCase connection.process assert_called(connection.websocket, :close) do - connection.close + connection.close(reason: "testing") end end end diff --git a/actioncable/test/connection/client_socket_test.rb b/actioncable/test/connection/client_socket_test.rb index a7db32c3e4..1ab3c3b71d 100644 --- a/actioncable/test/connection/client_socket_test.rb +++ b/actioncable/test/connection/client_socket_test.rb @@ -58,7 +58,7 @@ class ActionCable::Connection::ClientSocketTest < ActionCable::TestCase client.instance_variable_get("@stream") .instance_variable_get("@rack_hijack_io") .define_singleton_method(:close) { event.set } - connection.close + connection.close(reason: "testing") event.wait end end |