def METHOD_NAME(dummy_user, dummy_blocking, smtp, with_user, with_reason):
    br = dummy_blocking.blocked_rooms[0]
    assert br.state == BlockedRoom.State.pending
    kwargs = {}
    if with_user:
        kwargs['user'] = dummy_user
    if with_reason:
        kwargs['reason'] = 'foo'
    br.reject(**kwargs)
    assert br.state == BlockedRoom.State.rejected
    mail = extract_emails(smtp, one=True, to=dummy_blocking.created_by_user.email,
                          subject='[Indico] Room blocking REJECTED')
    if with_reason:
        assert kwargs['reason'] in mail.as_string()
    assert not smtp.outbox