diff options
author | Matthew Draper <matthew@trebex.net> | 2016-01-25 03:55:53 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2016-01-30 03:46:37 +1030 |
commit | ce37de4a19447fc89d2d16f15ba9314fba30d47e (patch) | |
tree | c1e562251ea6dccb2b9be1bd8ecf64294600146f /actioncable/test/client | |
parent | 16a6603956551703e3bbd06101c568a73bcdaa52 (diff) | |
download | rails-ce37de4a19447fc89d2d16f15ba9314fba30d47e.tar.gz rails-ce37de4a19447fc89d2d16f15ba9314fba30d47e.tar.bz2 rails-ce37de4a19447fc89d2d16f15ba9314fba30d47e.zip |
Add a couple of tests that connect with a WS client
Diffstat (limited to 'actioncable/test/client')
-rw-r--r-- | actioncable/test/client/echo_channel.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/actioncable/test/client/echo_channel.rb b/actioncable/test/client/echo_channel.rb new file mode 100644 index 0000000000..9a54080d4d --- /dev/null +++ b/actioncable/test/client/echo_channel.rb @@ -0,0 +1,13 @@ +class EchoChannel < ActionCable::Channel::Base + def subscribed + stream_from "global" + end + + def ding(data) + transmit(dong: data['message']) + end + + def bulk(data) + ActionCable.server.broadcast "global", wide: data['message'] + end +end |