testax

Crates.iotestax
lib.rstestax
version0.3.0
sourcesrc
created_at2020-05-10 22:00:19.63268
updated_at2020-09-25 22:39:37.364971
descriptionCrate for testing actix GET/POST/UPDATE/DELETE
homepage
repositoryhttps://github.com/fbucek/testax
max_upload_size
id239852
size10,863
(fbucek)

documentation

README

TestAx

Build Status Documentation crates.io

Simple crate for testing basic actix GET/POST/UPDATE/DELETE

[dev-dependencies]
testax = "0.1"

TODO

  • GET
  • POST
  • UPDATE
  • DELETE
  • Universal??

Minimal example

async fn index(info: web::Path<(u32, String)>) -> impl Responder {
    format!("Hello {}! id:{}", info.1, info.0)
}

#[actix_rt::test]
async fn test_minimal() {
    let mut app = test::init_service(App::new().service(index)).await;

    let resp = get(&mut app, "/32/Filip").await;
    assert_eq!(resp.status.as_u16(), 200);
    assert_eq!(resp.body, "Hello Filip! id:32");
}
Commit count: 11

cargo fmt