2017-07-16 13:10:15 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-06 13:15:15 -04:00
|
|
|
require "test_helper"
|
2016-05-16 00:07:35 -04:00
|
|
|
|
|
|
|
class SubscriberMapTest < ActionCable::TestCase
|
|
|
|
test "broadcast should not change subscribers" do
|
|
|
|
setup_subscription_map
|
|
|
|
origin = @subscription_map.instance_variable_get(:@subscribers).dup
|
|
|
|
|
2016-08-06 13:15:15 -04:00
|
|
|
@subscription_map.broadcast("not_exist_channel", "")
|
2016-05-16 00:07:35 -04:00
|
|
|
|
|
|
|
assert_equal origin, @subscription_map.instance_variable_get(:@subscribers)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
def setup_subscription_map
|
|
|
|
@subscription_map = ActionCable::SubscriptionAdapter::SubscriberMap.new
|
|
|
|
end
|
|
|
|
end
|