diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-25 00:12:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-25 00:12:47 +0300 |
commit | 1f3baf00bfdff196b43ade455d8268ce10ff13aa (patch) | |
tree | e86f3303f2353520b97ae0653a244b2a071c4453 /spec/initializers | |
parent | 844eb8879aa445d8a5ee0f2ba3ee1ccf18319ef1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/initializers')
-rw-r--r-- | spec/initializers/action_cable_subscription_adapter_identifier_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/initializers/action_cable_subscription_adapter_identifier_spec.rb b/spec/initializers/action_cable_subscription_adapter_identifier_spec.rb new file mode 100644 index 00000000000..12988b851ef --- /dev/null +++ b/spec/initializers/action_cable_subscription_adapter_identifier_spec.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'ActionCableSubscriptionAdapterIdentifier override' do + describe '#identifier' do + context 'when id key is nil on cable.yml' do + it 'does not override server config id with action cable pid' do + config = { + adapter: 'redis', + url: 'unix:/home/localuser/redis/redis.socket', + channel_prefix: 'test_', + id: nil + } + ::ActionCable::Server::Base.config.cable = config + + sub = ActionCable.server.pubsub.send(:redis_connection) + + expect(sub.connection[:id]).to eq('redis:///home/localuser/redis/redis.socket/0') + expect(ActionCable.server.config.cable[:id]).to be_nil + end + end + end +end |