aboutsummaryrefslogblamecommitdiffstats
path: root/test/channel_test.rb
blob: 96987977ea4a68635baa12128fb6ac304153b846 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                                          
                                              











                                                   
require 'test_helper'

class ChannelTest < ActionCableTest

  class PingChannel < ActionCable::Channel::Base
    def self.matches?(identifier)
      identifier[:channel] == 'chat' && identifier[:user_id].to_i.nonzero?
    end
  end

  class PingServer < ActionCable::Server::Base
    register_channels PingChannel
  end

  def app
    PingServer
  end

  test "channel callbacks" do
    ws = Faye::WebSocket::Client.new(websocket_url)
  end

end