From f55ecc6a7c7866a13fe9f5b84b295f2935c6ff1f Mon Sep 17 00:00:00 2001 From: Marc Ignacio Date: Thu, 22 Jun 2017 09:10:08 +0800 Subject: Allows for other common redis options to be in cable.yml, by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adds RedisAdapterTest::AlternateConfiguration to account for a relatively common alternative setup, as it’s used as the first example in the [Redis rubygem](https://github.com/redis/redis-rb#getting-started) - Supplies original RedisAdapterTest with more complete redis:// url format by adding a ‘userinfo’ (blank user), so that it resembles the alternate configuration - Supplies original EventedRedisAdapterTest with more complete redis:// url as well - Adds before_script to start redis-server with password as a daemon and with explicit defaults copied from the default redis.conf (Instead of using Travis' default init/upstart scripts for `redis` service) --- actioncable/test/subscription_adapter/redis_test.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'actioncable/test/subscription_adapter/redis_test.rb') diff --git a/actioncable/test/subscription_adapter/redis_test.rb b/actioncable/test/subscription_adapter/redis_test.rb index 11120b3f85..60596dd205 100644 --- a/actioncable/test/subscription_adapter/redis_test.rb +++ b/actioncable/test/subscription_adapter/redis_test.rb @@ -7,7 +7,7 @@ class RedisAdapterTest < ActionCable::TestCase include ChannelPrefixTest def cable_config - { adapter: "redis", driver: "ruby", url: "redis://127.0.0.1:6379/12" } + { adapter: "redis", driver: "ruby", url: "redis://:password@127.0.0.1:6379/12" } end end @@ -16,3 +16,11 @@ class RedisAdapterTest::Hiredis < RedisAdapterTest super.merge(driver: "hiredis") end end + +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, password: "password") + end +end -- cgit v1.2.3