Module: ActionCable::Connection::Assertions
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
| Included In: | |
| Defined in: | actioncable/lib/action_cable/connection/test_case.rb | 
Instance Method Summary
- 
    
      #assert_reject_connection(&block)  
    
    Asserts that the connection is rejected (via reject_unauthorized_connection).
Instance Method Details
#assert_reject_connection(&block)
Asserts that the connection is rejected (via 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