aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test
diff options
context:
space:
mode:
authorpalkan <dementiev.vm@gmail.com>2017-07-06 17:34:05 +0300
committerpalkan <dementiev.vm@gmail.com>2017-07-06 17:34:05 +0300
commit2bce7777b70efe81f45e4ae8dc61b25f1e18771e (patch)
tree31ebb4f359bd8b604621d510b9c6944be4eecc96 /actioncable/test
parentc8ce3459648ce0f86646b564ce1c0bb16a4b48eb (diff)
downloadrails-2bce7777b70efe81f45e4ae8dc61b25f1e18771e.tar.gz
rails-2bce7777b70efe81f45e4ae8dc61b25f1e18771e.tar.bz2
rails-2bce7777b70efe81f45e4ae8dc61b25f1e18771e.zip
[Fix #28751] Hash stream long stream identifiers when using Postgres adapter
Diffstat (limited to 'actioncable/test')
-rw-r--r--actioncable/test/subscription_adapter/common.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actioncable/test/subscription_adapter/common.rb b/actioncable/test/subscription_adapter/common.rb
index 3aa88c2caa..80baf2f771 100644
--- a/actioncable/test/subscription_adapter/common.rb
+++ b/actioncable/test/subscription_adapter/common.rb
@@ -112,4 +112,18 @@ module CommonSubscriptionAdapterTest
assert_equal "two", queue.pop
end
end
+
+ def test_long_identifiers
+ channel_1 = "a" * 100 + "1"
+ channel_2 = "a" * 100 + "2"
+ subscribe_as_queue(channel_1) do |queue|
+ subscribe_as_queue(channel_2) do |queue_2|
+ @tx_adapter.broadcast(channel_1, "apples")
+ @tx_adapter.broadcast(channel_2, "oranges")
+
+ assert_equal "apples", queue.pop
+ assert_equal "oranges", queue_2.pop
+ end
+ end
+ end
end