class ActionCable::StreamTests::ChatChannel

Public Instance Methods

send_confirmation() click to toggle source
# File actioncable/test/channel/stream_test.rb, line 24
def send_confirmation
  transmit_subscription_confirmation
end
subscribed() click to toggle source
# File actioncable/test/channel/stream_test.rb, line 17
def subscribed
  if params[:id]
    @room = Room.new params[:id]
    stream_from "test_room_#{@room.id}", coder: pick_coder(params[:coder])
  end
end

Private Instance Methods

pick_coder(coder) click to toggle source
# File actioncable/test/channel/stream_test.rb, line 28
        def pick_coder(coder)
  case coder
  when nil, "json"
    ActiveSupport::JSON
  when "custom"
    DummyEncoder
  when "none"
    nil
  end
end