aboutsummaryrefslogtreecommitdiffstats
path: root/test/connection
diff options
context:
space:
mode:
Diffstat (limited to 'test/connection')
-rw-r--r--test/connection/identifier_test.rb4
-rw-r--r--test/connection/subscriptions_test.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/test/connection/identifier_test.rb b/test/connection/identifier_test.rb
index f34b66f9fd..02e6b21845 100644
--- a/test/connection/identifier_test.rb
+++ b/test/connection/identifier_test.rb
@@ -40,7 +40,7 @@ class ActionCable::Connection::IdentifierTest < ActionCable::TestCase
open_connection_with_stubbed_pubsub
@connection.websocket.expects(:close)
- message = { 'type' => 'disconnect' }.to_json
+ message = ActiveSupport::JSON.encode('type' => 'disconnect')
@connection.process_internal_message message
end
end
@@ -50,7 +50,7 @@ class ActionCable::Connection::IdentifierTest < ActionCable::TestCase
open_connection_with_stubbed_pubsub
@connection.websocket.expects(:close).never
- message = { 'type' => 'unknown' }.to_json
+ message = ActiveSupport::JSON.encode('type' => 'unknown')
@connection.process_internal_message message
end
end
diff --git a/test/connection/subscriptions_test.rb b/test/connection/subscriptions_test.rb
index 55ad74b962..4f6760827e 100644
--- a/test/connection/subscriptions_test.rb
+++ b/test/connection/subscriptions_test.rb
@@ -27,7 +27,7 @@ class ActionCable::Connection::SubscriptionsTest < ActionCable::TestCase
@server = TestServer.new
@server.stubs(:channel_classes).returns(ChatChannel.name => ChatChannel)
- @chat_identifier = { id: 1, channel: 'ActionCable::Connection::SubscriptionsTest::ChatChannel' }.to_json
+ @chat_identifier = ActiveSupport::JSON.encode(id: 1, channel: 'ActionCable::Connection::SubscriptionsTest::ChatChannel')
end
test "subscribe command" do
@@ -77,7 +77,7 @@ class ActionCable::Connection::SubscriptionsTest < ActionCable::TestCase
channel = subscribe_to_chat_channel
data = { 'content' => 'Hello World!', 'action' => 'speak' }
- @subscriptions.execute_command 'command' => 'message', 'identifier' => @chat_identifier, 'data' => data.to_json
+ @subscriptions.execute_command 'command' => 'message', 'identifier' => @chat_identifier, 'data' => ActiveSupport::JSON.encode(data)
assert_equal [ data ], channel.lines
end
@@ -89,7 +89,7 @@ class ActionCable::Connection::SubscriptionsTest < ActionCable::TestCase
channel1 = subscribe_to_chat_channel
- channel2_id = { id: 2, channel: 'ActionCable::Connection::SubscriptionsTest::ChatChannel' }.to_json
+ channel2_id = ActiveSupport::JSON.encode(id: 2, channel: 'ActionCable::Connection::SubscriptionsTest::ChatChannel')
channel2 = subscribe_to_chat_channel(channel2_id)
channel1.expects(:unsubscribe_from_channel)