pub fn logout(srv: &mut TestServer, token: Option<&str>, code: StatusCode) {
    let mut request = srv.post();
    let mut request = request.uri(srv.url("/logout"));

    if token.is_some() {
        add_token_to_request(&mut request, token.unwrap());
    }

    let request = request.finish().unwrap();

    assert!(check_response(srv, request, code));
}
/// Attempts to log the user out with the provided token
///
/// # Arguments
///
/// * `srv` - An instance of a TestServer
/// * `token` - The token corresponding to the user to log out, or None
/// * `code` - Status code to expect (200 Ok, 401 Unauthorized, etc...)
Attempts to log the user out with the provided token
Attempts to log the user out with the provided token
pub fn logout(srv: &mut TestServer, token: Option<&str>, code: StatusCode) {
    let mut request = srv.post();
    let mut request = request.uri(srv.url("/logout"));
    if token.is_some() {
        add_token_to_request(&mut request, token.unwrap());
    }
    let request = request.finish().unwrap();
    assert!(check_response(srv, request, code));
}
pub fn logout ( srv : & mut TestServer , token : Option < & str > , code : StatusCode ) { let mut request = srv . post ( ) ; let mut request = request . uri ( srv . url ( " " ) ) ; if token . is_some ( ) { add_token_to_request ( & mut request , token . unwrap ( ) ) ; } let request = request . finish ( ) . unwrap ( ) ; assert ! ( check_response ( srv request code ) ) ; }
Attempts to log the user out with the provided token
Attempts to log the user out with the provided token
srv
&mut TestServer
token
Option<&str>
code
StatusCode
srv
&mut TestServer
token
Option<&str>
code
StatusCode