aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/subscription_adapter
diff options
context:
space:
mode:
authorIlia Kasianenko <i.kasianenko@gmail.com>2018-09-05 16:54:44 +0300
committerIlia Kasianenko <i.kasianenko@gmail.com>2018-09-05 16:54:44 +0300
commitbcd11e07b5369b661e869631dc485fd5e3ce88a5 (patch)
tree50ac04f30ef265a31b58f8143acf42f2d0f62fb1 /actioncable/test/subscription_adapter
parentbd932f5d2244185527c57d81ee7b6a7762560ab5 (diff)
downloadrails-bcd11e07b5369b661e869631dc485fd5e3ce88a5.tar.gz
rails-bcd11e07b5369b661e869631dc485fd5e3ce88a5.tar.bz2
rails-bcd11e07b5369b661e869631dc485fd5e3ce88a5.zip
ActionCable: add id option to redis adapter config
Diffstat (limited to 'actioncable/test/subscription_adapter')
-rw-r--r--actioncable/test/subscription_adapter/redis_test.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/actioncable/test/subscription_adapter/redis_test.rb b/actioncable/test/subscription_adapter/redis_test.rb
index 3dc995331a..7874bfcfa8 100644
--- a/actioncable/test/subscription_adapter/redis_test.rb
+++ b/actioncable/test/subscription_adapter/redis_test.rb
@@ -30,14 +30,22 @@ class RedisAdapterTest::AlternateConfiguration < RedisAdapterTest
end
class RedisAdapterTest::Connector < ActionCable::TestCase
- test "slices url, host, port, db, and password from config" do
- config = { url: 1, host: 2, port: 3, db: 4, password: 5 }
+ test "slices url, host, port, db, password and id from config" do
+ config = { url: 1, host: 2, port: 3, db: 4, password: 5, id: "Some custom ID" }
assert_called_with ::Redis, :new, [ config ] do
connect config.merge(other: "unrelated", stuff: "here")
end
end
+ test "adds default id if it is not specified" do
+ config = { url: 1, host: 2, port: 3, db: 4, password: 5, id: "ActionCable1-PID-#{$$}" }
+
+ assert_called_with ::Redis, :new, [ config ] do
+ connect config
+ end
+ end
+
def connect(config)
ActionCable::SubscriptionAdapter::Redis.redis_connector.call(config)
end