跳至内容 跳至搜索
方法
A

实例公共方法

assert_reject_connection(&block)

断言连接被拒绝(通过 reject_unauthorized_connection)。

# Asserts that connection without user_id fails
assert_reject_connection { connect params: { user_id: '' } }
# File actioncable/lib/action_cable/connection/test_case.rb, line 28
def assert_reject_connection(&block)
  assert_raises(Authorization::UnauthorizedError, "Expected to reject connection but no rejection was made", &block)
end