diff options
author | Matthew Draper <matthew@trebex.net> | 2016-02-25 14:31:19 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2016-03-02 02:14:20 +1030 |
commit | 185c93eb0c8df629033be48e5eef431190c65226 (patch) | |
tree | 3c4896212c15aace270ef35bc5fb036c7c1c315a /actioncable/test/client_test.rb | |
parent | d3c9d808e3e242155a44fd2a89ef272cfade8fe8 (diff) | |
download | rails-185c93eb0c8df629033be48e5eef431190c65226.tar.gz rails-185c93eb0c8df629033be48e5eef431190c65226.tar.bz2 rails-185c93eb0c8df629033be48e5eef431190c65226.zip |
Use AS::Executor / AS::Reloader to support reloading in ActionCable
Diffstat (limited to 'actioncable/test/client_test.rb')
-rw-r--r-- | actioncable/test/client_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/actioncable/test/client_test.rb b/actioncable/test/client_test.rb index 1b07689127..a6619d3bd2 100644 --- a/actioncable/test/client_test.rb +++ b/actioncable/test/client_test.rb @@ -127,8 +127,16 @@ class ClientTest < ActionCable::TestCase end @ws.close + wait_for_close + end + + def wait_for_close @closed.wait(WAIT_WHEN_EXPECTING_EVENT) end + + def closed? + @closed.set? + end end def faye_client(port) @@ -220,4 +228,16 @@ class ClientTest < ActionCable::TestCase assert_equal(0, app.connections.count) end end + + def test_server_restart + with_puma_server do |port| + c = faye_client(port) + c.send_message command: 'subscribe', identifier: JSON.dump(channel: 'EchoChannel') + assert_equal({"identifier"=>"{\"channel\":\"EchoChannel\"}", "type"=>"confirm_subscription"}, c.read_message) + + ActionCable.server.restart + c.wait_for_close + assert c.closed? + end + end end |