fix: do not use TestServer in ConnectionStub

It's an internal testing entity, we cannot use it in a test case class
This commit is contained in:
Vladimir Dementyev 2023-02-23 15:31:58 -05:00
parent b0dd7c7ae2
commit 8fff6d609c
No known key found for this signature in database
GPG Key ID: 3371F3988C3C18A3
4 changed files with 5 additions and 5 deletions

View File

@ -286,7 +286,7 @@ module ActionCable
end
def parameter_filter
@parameter_filter ||= ActiveSupport::ParameterFilter.new(connection.server.config.filter_parameters)
@parameter_filter ||= ActiveSupport::ParameterFilter.new(connection.config.filter_parameters)
end
def transmit_subscription_confirmation

View File

@ -45,7 +45,7 @@ module ActionCable
end
class ConnectionStub
attr_reader :transmissions, :identifiers, :subscriptions, :logger, :server
attr_reader :transmissions, :identifiers, :subscriptions, :logger, :config
def initialize(identifiers = {})
@transmissions = []
@ -57,7 +57,7 @@ module ActionCable
@subscriptions = ActionCable::Connection::Subscriptions.new(self)
@identifiers = identifiers.keys
@logger = ActiveSupport::TaggedLogging.new ActiveSupport::Logger.new(StringIO.new)
@server = TestServer.new
@config = ActionCable::Server::Configuration.new
end
def transmit(cable_message)

View File

@ -51,7 +51,7 @@ module ActionCable
include ActiveSupport::Rescuable
attr_reader :server, :env, :subscriptions, :logger, :worker_pool, :protocol
delegate :event_loop, :pubsub, to: :server
delegate :event_loop, :pubsub, :config, to: :server
def initialize(server, env, coder: ActiveSupport::JSON)
@server, @env, @coder = server, env, coder

View File

@ -5,7 +5,7 @@ require "stubs/user"
class TestConnection
attr_reader :identifiers, :logger, :current_user, :server, :subscriptions, :transmissions
delegate :pubsub, to: :server
delegate :pubsub, :config, to: :server
def initialize(user = User.new("lifo"), coder: ActiveSupport::JSON, subscription_adapter: SuccessAdapter)
@coder = coder