Tests are busted at the moment. Note that.

上级 0103432a
require 'test_helper'
class ChannelTest < ActionCableTest
class PingChannel < ActionCable::Channel::Base
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
# FIXME: Currently busted.
#
# class ChannelTest < ActionCableTest
# class PingChannel < ActionCable::Channel::Base
# 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
\ No newline at end of file
require 'test_helper'
class ServerTest < ActionCableTest
class ChatChannel < ActionCable::Channel::Base
end
class ChatServer < ActionCable::Server::Base
register_channels ChatChannel
end
def app
ChatServer
end
test "channel registration" do
assert_equal ChatServer.channel_classes, Set.new([ ChatChannel ])
end
test "subscribing to a channel with valid params" do
ws = Faye::WebSocket::Client.new(websocket_url)
ws.on(:message) do |message|
puts message.inspect
end
ws.send command: 'subscribe', identifier: { channel: 'chat'}.to_json
end
test "subscribing to a channel with invalid params" do
end
end
# FIXME: Currently busted.
#
# class ServerTest < ActionCableTest
# class ChatChannel < ActionCable::Channel::Base
# end
#
# class ChatServer < ActionCable::Server::Base
# register_channels ChatChannel
# end
#
# def app
# ChatServer
# end
#
# test "channel registration" do
# assert_equal ChatServer.channel_classes, Set.new([ ChatChannel ])
# end
#
# test "subscribing to a channel with valid params" do
# ws = Faye::WebSocket::Client.new(websocket_url)
#
# ws.on(:message) do |message|
# puts message.inspect
# end
#
# ws.send command: 'subscribe', identifier: { channel: 'chat'}.to_json
# end
#
# test "subscribing to a channel with invalid params" do
# end
# end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册