1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actioncable/test/server/base_test.rb
Matthew Draper 87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590, reversing
changes made to afb66a5a59.
2017-07-02 02:15:17 +09:30

33 lines
728 B
Ruby

require "test_helper"
require "stubs/test_server"
require "active_support/core_ext/hash/indifferent_access"
class BaseTest < ActiveSupport::TestCase
def setup
@server = ActionCable::Server::Base.new
@server.config.cable = { adapter: "async" }.with_indifferent_access
end
class FakeConnection
def close
end
end
test "#restart closes all open connections" do
conn = FakeConnection.new
@server.add_connection(conn)
conn.expects(:close)
@server.restart
end
test "#restart shuts down worker pool" do
@server.worker_pool.expects(:halt)
@server.restart
end
test "#restart shuts down pub/sub adapter" do
@server.pubsub.expects(:shutdown)
@server.restart
end
end