mirror of https://github.com/rails/rails
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:
parent
b0dd7c7ae2
commit
8fff6d609c
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue