aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/client
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-01-25 03:55:53 +1030
committerMatthew Draper <matthew@trebex.net>2016-01-30 03:46:37 +1030
commitce37de4a19447fc89d2d16f15ba9314fba30d47e (patch)
treec1e562251ea6dccb2b9be1bd8ecf64294600146f /actioncable/test/client
parent16a6603956551703e3bbd06101c568a73bcdaa52 (diff)
downloadrails-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.rb13
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