Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9524d752
Commit
9524d752
authored
Nov 24, 2021
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for override
parent
57141bd0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
lib/gitlab/patch/action_cable_subscription_adapter_identifier.rb
...lab/patch/action_cable_subscription_adapter_identifier.rb
+1
-1
spec/initializers/action_cable_subscription_adapter_identifier_spec.rb
...zers/action_cable_subscription_adapter_identifier_spec.rb
+24
-0
No files found.
lib/gitlab/patch/action_cable_subscription_adapter_identifier.rb
View file @
9524d752
...
...
@@ -8,7 +8,7 @@ module Gitlab
module
Patch
module
ActionCableSubscriptionAdapterIdentifier
def
identifier
@server
.
config
.
cable
.
has_key?
(
:id
)
?
@server
.
config
.
cable
[
:id
]
:
"ActionCable-PID-
#{
$$
}
"
# rubocop:disable Gitlab/ModuleWithInstanceVariables
@server
.
config
.
cable
.
has_key?
(
:id
)
?
@server
.
config
.
cable
[
:id
]
:
super
# rubocop:disable Gitlab/ModuleWithInstanceVariables
end
end
end
...
...
spec/initializers/action_cable_subscription_adapter_identifier_spec.rb
0 → 100644
View file @
9524d752
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment