diff options
Diffstat (limited to 'actioncable/test')
-rw-r--r-- | actioncable/test/subscription_adapter/redis_test.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actioncable/test/subscription_adapter/redis_test.rb b/actioncable/test/subscription_adapter/redis_test.rb index ac2d8ef724..35840a4036 100644 --- a/actioncable/test/subscription_adapter/redis_test.rb +++ b/actioncable/test/subscription_adapter/redis_test.rb @@ -11,7 +11,11 @@ class RedisAdapterTest < ActionCable::TestCase include ChannelPrefixTest def cable_config - { adapter: "redis", driver: "ruby" } + { adapter: "redis", driver: "ruby" }.tap do |x| + if host = URI(ENV["REDIS_URL"] || "").hostname + x[:host] = host + end + end end end @@ -25,7 +29,7 @@ class RedisAdapterTest::AlternateConfiguration < RedisAdapterTest def cable_config alt_cable_config = super.dup alt_cable_config.delete(:url) - alt_cable_config.merge(host: "127.0.0.1", port: 6379, db: 12) + alt_cable_config.merge(host: URI(ENV["REDIS_URL"] || "").hostname || "127.0.0.1", port: 6379, db: 12) end end |