Merge pull request #22639 from arunagw/aa-remove-few-warnings-actioncable

Remove warnings from actioncable test
This commit is contained in:
Guillermo Iguaran 2015-12-17 17:47:39 -05:00
commit 80e00ac84a
7 changed files with 13 additions and 6 deletions

@ -137,6 +137,9 @@ def initialize(connection, identifier, params = {})
# transmission until redis pubsub subscription is confirmed.
@defer_subscription_confirmation = false
@reject_subscription = nil
@subscription_confirmation_sent = nil
delegate_connection_identifiers
subscribe_to_channel
end

@ -62,6 +62,7 @@ def initialize(server, env)
@subscriptions = ActionCable::Connection::Subscriptions.new(self)
@message_buffer = ActionCable::Connection::MessageBuffer.new(self)
@_internal_redis_subscriptions = nil
@started_at = Time.now
end
@ -138,10 +139,11 @@ def cookies
end
private
protected
attr_reader :websocket
attr_reader :message_buffer
private
def on_open
connect if respond_to?(:connect)
subscribe_to_internal_channel

@ -29,10 +29,11 @@ def process!
receive_buffered_messages
end
private
protected
attr_reader :connection
attr_accessor :buffered_messages
private
def valid?(message)
message.is_a?(String)
end

@ -58,9 +58,10 @@ def unsubscribe_from_all
subscriptions.each { |id, channel| channel.unsubscribe_from_channel }
end
protected
attr_reader :connection, :subscriptions
private
attr_reader :connection, :subscriptions
delegate :logger, to: :connection
def find(data)

@ -22,7 +22,7 @@ def transmit(data)
websocket.send data
end
private
protected
attr_reader :websocket
end
end

@ -45,7 +45,7 @@ def send_confirmation
connection = TestConnection.new
connection.expects(:pubsub).returns EM::Hiredis.connect.pubsub
channel = ChatChannel.new connection, "{id: 1}", { id: 1 }
ChatChannel.new connection, "{id: 1}", { id: 1 }
assert_nil connection.last_transmission
EM::Timer.new(0.1) do

@ -57,7 +57,7 @@ def send_async(method, *args)
private
def assert_origin_allowed(origin)
response = connect_with_origin origin
assert_equal -1, response[0]
assert_equal(-1, response[0])
end
def assert_origin_not_allowed(origin)