diff options
author | Jay Hayes <ur@iamvery.com> | 2016-02-24 12:38:48 -0600 |
---|---|---|
committer | Jay Hayes <ur@iamvery.com> | 2016-02-24 17:22:06 -0600 |
commit | 3ecab078008ca5ce1582cd88d88840504ebed571 (patch) | |
tree | 11a650664085d010275f61ce73568e4952a59ab4 /actioncable/test | |
parent | 046e32656efa989a112e9870d8aa25a49f944204 (diff) | |
download | rails-3ecab078008ca5ce1582cd88d88840504ebed571.tar.gz rails-3ecab078008ca5ce1582cd88d88840504ebed571.tar.bz2 rails-3ecab078008ca5ce1582cd88d88840504ebed571.zip |
Ensure server broadcasts are to string queue names
Similar to the channel streaming side, these values must be strings for
ActionCable to behave as expected. The conversion will allow users to
send string-convertible values and get the expected behavior.
Diffstat (limited to 'actioncable/test')
-rw-r--r-- | actioncable/test/server/broadcasting_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actioncable/test/server/broadcasting_test.rb b/actioncable/test/server/broadcasting_test.rb new file mode 100644 index 0000000000..3b4a7eaf90 --- /dev/null +++ b/actioncable/test/server/broadcasting_test.rb @@ -0,0 +1,15 @@ +require "test_helper" + +class BroadcastingTest < ActiveSupport::TestCase + class TestServer + include ActionCable::Server::Broadcasting + end + + test "fetching a broadcaster converts the broadcasting queue to a string" do + broadcasting = :test_queue + server = TestServer.new + broadcaster = server.broadcaster_for(broadcasting) + + assert_equal "test_queue", broadcaster.broadcasting + end +end |