aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test
diff options
context:
space:
mode:
authorVladimir Dementyev <dementiev.vm@gmail.com>2018-12-14 16:46:39 -0500
committerVladimir Dementyev <dementiev.vm@gmail.com>2019-02-12 17:17:46 -0500
commit3cd69fa2c025da1cc45b1b9b43b227cceb025837 (patch)
treeacd23f3be831673cb04a49ef847aff6876c47c57 /actioncable/test
parent7432e251873690234d0d288e8eb009fbee80b635 (diff)
downloadrails-3cd69fa2c025da1cc45b1b9b43b227cceb025837.tar.gz
rails-3cd69fa2c025da1cc45b1b9b43b227cceb025837.tar.bz2
rails-3cd69fa2c025da1cc45b1b9b43b227cceb025837.zip
Allow passing custom config to ActionCable::Server::Base
That allows us to create a separate, isolated Action Cable server instance within the same app.
Diffstat (limited to 'actioncable/test')
-rw-r--r--actioncable/test/subscription_adapter/channel_prefix.rb10
1 files changed, 1 insertions, 9 deletions
diff --git a/actioncable/test/subscription_adapter/channel_prefix.rb b/actioncable/test/subscription_adapter/channel_prefix.rb
index 3071facd9d..475e6cfd3a 100644
--- a/actioncable/test/subscription_adapter/channel_prefix.rb
+++ b/actioncable/test/subscription_adapter/channel_prefix.rb
@@ -2,17 +2,9 @@
require "test_helper"
-class ActionCable::Server::WithIndependentConfig < ActionCable::Server::Base
- # ActionCable::Server::Base defines config as a class variable.
- # Need config to be an instance variable here as we're testing 2 separate configs
- def config
- @config ||= ActionCable::Server::Configuration.new
- end
-end
-
module ChannelPrefixTest
def test_channel_prefix
- server2 = ActionCable::Server::WithIndependentConfig.new
+ server2 = ActionCable::Server::Base.new(config: ActionCable::Server::Configuration.new)
server2.config.cable = alt_cable_config
server2.config.logger = Logger.new(StringIO.new).tap { |l| l.level = Logger::UNKNOWN }