aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2015-12-17 17:47:39 -0500
committerGuillermo Iguaran <guilleiguaran@gmail.com>2015-12-17 17:47:39 -0500
commit80e00ac84adf84485adaebb7e38787e00d663ba5 (patch)
tree74921d60c7a2d255e5bf4c639653785d41fc8cdd /actioncable
parent1fca600b18c7bb6720450b2b80c1859f48d54d66 (diff)
parente1459c7c86363d941191551505ad083d4335b815 (diff)
downloadrails-80e00ac84adf84485adaebb7e38787e00d663ba5.tar.gz
rails-80e00ac84adf84485adaebb7e38787e00d663ba5.tar.bz2
rails-80e00ac84adf84485adaebb7e38787e00d663ba5.zip
Merge pull request #22639 from arunagw/aa-remove-few-warnings-actioncable
Remove warnings from actioncable test
Diffstat (limited to 'actioncable')
-rw-r--r--actioncable/lib/action_cable/channel/base.rb3
-rw-r--r--actioncable/lib/action_cable/connection/base.rb4
-rw-r--r--actioncable/lib/action_cable/connection/message_buffer.rb3
-rw-r--r--actioncable/lib/action_cable/connection/subscriptions.rb3
-rw-r--r--actioncable/lib/action_cable/connection/web_socket.rb2
-rw-r--r--actioncable/test/channel/stream_test.rb2
-rw-r--r--actioncable/test/connection/cross_site_forgery_test.rb2
7 files changed, 13 insertions, 6 deletions
diff --git a/actioncable/lib/action_cable/channel/base.rb b/actioncable/lib/action_cable/channel/base.rb
index ca903a810d..f3085840ca 100644
--- a/actioncable/lib/action_cable/channel/base.rb
+++ b/actioncable/lib/action_cable/channel/base.rb
@@ -137,6 +137,9 @@ module ActionCable
# 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
diff --git a/actioncable/lib/action_cable/connection/base.rb b/actioncable/lib/action_cable/connection/base.rb
index 7e9eec7508..f7b18a85ae 100644
--- a/actioncable/lib/action_cable/connection/base.rb
+++ b/actioncable/lib/action_cable/connection/base.rb
@@ -62,6 +62,7 @@ module ActionCable
@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 @@ module ActionCable
end
- private
+ protected
attr_reader :websocket
attr_reader :message_buffer
+ private
def on_open
connect if respond_to?(:connect)
subscribe_to_internal_channel
diff --git a/actioncable/lib/action_cable/connection/message_buffer.rb b/actioncable/lib/action_cable/connection/message_buffer.rb
index 25cff75b41..2f65a1e84a 100644
--- a/actioncable/lib/action_cable/connection/message_buffer.rb
+++ b/actioncable/lib/action_cable/connection/message_buffer.rb
@@ -29,10 +29,11 @@ module ActionCable
receive_buffered_messages
end
- private
+ protected
attr_reader :connection
attr_accessor :buffered_messages
+ private
def valid?(message)
message.is_a?(String)
end
diff --git a/actioncable/lib/action_cable/connection/subscriptions.rb b/actioncable/lib/action_cable/connection/subscriptions.rb
index 6199db4898..65d6634bb0 100644
--- a/actioncable/lib/action_cable/connection/subscriptions.rb
+++ b/actioncable/lib/action_cable/connection/subscriptions.rb
@@ -58,9 +58,10 @@ module ActionCable
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)
diff --git a/actioncable/lib/action_cable/connection/web_socket.rb b/actioncable/lib/action_cable/connection/web_socket.rb
index 169b683b8c..670d5690ae 100644
--- a/actioncable/lib/action_cable/connection/web_socket.rb
+++ b/actioncable/lib/action_cable/connection/web_socket.rb
@@ -22,7 +22,7 @@ module ActionCable
websocket.send data
end
- private
+ protected
attr_reader :websocket
end
end
diff --git a/actioncable/test/channel/stream_test.rb b/actioncable/test/channel/stream_test.rb
index 5e4e01abbf..1424ded04c 100644
--- a/actioncable/test/channel/stream_test.rb
+++ b/actioncable/test/channel/stream_test.rb
@@ -45,7 +45,7 @@ class ActionCable::Channel::StreamTest < ActionCable::TestCase
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
diff --git a/actioncable/test/connection/cross_site_forgery_test.rb b/actioncable/test/connection/cross_site_forgery_test.rb
index ede3057e30..d445e08f2a 100644
--- a/actioncable/test/connection/cross_site_forgery_test.rb
+++ b/actioncable/test/connection/cross_site_forgery_test.rb
@@ -57,7 +57,7 @@ class ActionCable::Connection::CrossSiteForgeryTest < ActionCable::TestCase
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)