方法
实例公共方法
assert_reject_connection(&block) 链接
断言连接被拒绝(通过 reject_unauthorized_connection
)。
# Asserts that connection without user_id fails
assert_reject_connection { connect params: { user_id: '' } }
来源:显示 | 在 GitHub 上
# 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