aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/connection/identifier_test.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 19:15:15 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 19:15:15 +0200
commitf8477f13bfe554064bd25a57e5289b4ebaabb504 (patch)
treec093f4e8c108a6ac0e6d27c5d6649eab97cc48bb /actioncable/test/connection/identifier_test.rb
parentb678eb57e93423ac8e2a0cc0b083ce556c6fb130 (diff)
downloadrails-f8477f13bfe554064bd25a57e5289b4ebaabb504.tar.gz
rails-f8477f13bfe554064bd25a57e5289b4ebaabb504.tar.bz2
rails-f8477f13bfe554064bd25a57e5289b4ebaabb504.zip
applies new string literal convention in actioncable/test
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'actioncable/test/connection/identifier_test.rb')
-rw-r--r--actioncable/test/connection/identifier_test.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/actioncable/test/connection/identifier_test.rb b/actioncable/test/connection/identifier_test.rb
index b48d9af809..a4dfcc06f0 100644
--- a/actioncable/test/connection/identifier_test.rb
+++ b/actioncable/test/connection/identifier_test.rb
@@ -1,6 +1,6 @@
-require 'test_helper'
-require 'stubs/test_server'
-require 'stubs/user'
+require "test_helper"
+require "stubs/test_server"
+require "stubs/user"
class ActionCable::Connection::IdentifierTest < ActionCable::TestCase
class Connection < ActionCable::Connection::Base
@@ -23,9 +23,9 @@ class ActionCable::Connection::IdentifierTest < ActionCable::TestCase
test "should subscribe to internal channel on open and unsubscribe on close" do
run_in_eventmachine do
- pubsub = mock('pubsub_adapter')
- pubsub.expects(:subscribe).with('action_cable/User#lifo', kind_of(Proc))
- pubsub.expects(:unsubscribe).with('action_cable/User#lifo', kind_of(Proc))
+ pubsub = mock("pubsub_adapter")
+ pubsub.expects(:subscribe).with("action_cable/User#lifo", kind_of(Proc))
+ pubsub.expects(:unsubscribe).with("action_cable/User#lifo", kind_of(Proc))
server = TestServer.new
server.stubs(:pubsub).returns(pubsub)
@@ -40,7 +40,7 @@ class ActionCable::Connection::IdentifierTest < ActionCable::TestCase
open_connection_with_stubbed_pubsub
@connection.websocket.expects(:close)
- @connection.process_internal_message 'type' => 'disconnect'
+ @connection.process_internal_message "type" => "disconnect"
end
end
@@ -49,20 +49,20 @@ class ActionCable::Connection::IdentifierTest < ActionCable::TestCase
open_connection_with_stubbed_pubsub
@connection.websocket.expects(:close).never
- @connection.process_internal_message 'type' => 'unknown'
+ @connection.process_internal_message "type" => "unknown"
end
end
protected
def open_connection_with_stubbed_pubsub
server = TestServer.new
- server.stubs(:adapter).returns(stub_everything('adapter'))
+ server.stubs(:adapter).returns(stub_everything("adapter"))
open_connection server: server
end
def open_connection(server:)
- env = Rack::MockRequest.env_for "/test", 'HTTP_HOST' => 'localhost', 'HTTP_CONNECTION' => 'upgrade', 'HTTP_UPGRADE' => 'websocket'
+ env = Rack::MockRequest.env_for "/test", "HTTP_HOST" => "localhost", "HTTP_CONNECTION" => "upgrade", "HTTP_UPGRADE" => "websocket"
@connection = Connection.new(server, env)
@connection.process