diff options
Diffstat (limited to 'actioncable/test/stubs')
-rw-r--r-- | actioncable/test/stubs/test_adapter.rb | 4 | ||||
-rw-r--r-- | actioncable/test/stubs/test_connection.rb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/actioncable/test/stubs/test_adapter.rb b/actioncable/test/stubs/test_adapter.rb index c481046973..5f23a137ea 100644 --- a/actioncable/test/stubs/test_adapter.rb +++ b/actioncable/test/stubs/test_adapter.rb @@ -1,12 +1,16 @@ # frozen_string_literal: true class SuccessAdapter < ActionCable::SubscriptionAdapter::Base + class << self; attr_accessor :subscribe_called, :unsubscribe_called end + def broadcast(channel, payload) end def subscribe(channel, callback, success_callback = nil) + @@subscribe_called = { channel: channel, callback: callback, success_callback: success_callback } end def unsubscribe(channel, callback) + @@unsubscribe_called = { channel: channel, callback: callback } end end diff --git a/actioncable/test/stubs/test_connection.rb b/actioncable/test/stubs/test_connection.rb index fdddd1159e..155c68e38c 100644 --- a/actioncable/test/stubs/test_connection.rb +++ b/actioncable/test/stubs/test_connection.rb @@ -3,7 +3,7 @@ require "stubs/user" class TestConnection - attr_reader :identifiers, :logger, :current_user, :server, :transmissions + attr_reader :identifiers, :logger, :current_user, :server, :subscriptions, :transmissions delegate :pubsub, to: :server |