From 60e2fa5e955ce819c90f2081320554b5ed0ee83c Mon Sep 17 00:00:00 2001
From: Lachlan Sylvester <lachlan.sylvester@publicisfrontfoot.com.au>
Date: Tue, 28 Jul 2015 15:13:07 +1000
Subject: refactor channel look up to use a hash instead of an array and reduce
 the number of calls to safe_constantize because it can be slow

---
 test/connection/subscriptions_test.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'test/connection')

diff --git a/test/connection/subscriptions_test.rb b/test/connection/subscriptions_test.rb
index 4e134b6420..24fe8f9300 100644
--- a/test/connection/subscriptions_test.rb
+++ b/test/connection/subscriptions_test.rb
@@ -20,7 +20,7 @@ class ActionCable::Connection::SubscriptionsTest < ActiveSupport::TestCase
 
   setup do
     @server = TestServer.new
-    @server.stubs(:channel_classes).returns([ ChatChannel ])
+    @server.stubs(:channel_classes).returns(ChatChannel.name => ChatChannel)
 
     env = Rack::MockRequest.env_for "/test", 'HTTP_CONNECTION' => 'upgrade', 'HTTP_UPGRADE' => 'websocket'
     @connection = Connection.new(@server, env)
-- 
cgit v1.2.3