1
0
mirror of https://github.com/actix/examples synced 2025-06-28 18:00:37 +02:00

Fix form example's test (#216)

* Update method name

* Fix typo
This commit is contained in:
Yuki Okushi
2019-12-23 03:51:33 +09:00
committed by GitHub
parent d914b1c694
commit e2f17fc21e
2 changed files with 5 additions and 4 deletions

View File

@ -141,13 +141,14 @@ mod tests {
.data(AppState {
foo: "bar".to_string(),
})
.to_http_request()
.get_app_data()
.to_http_request();
let data = state
.app_data::<actix_web::web::Data<AppState>>()
.unwrap();
let params = Form(MyParams {
name: "John".to_string(),
});
let resp = handle_post_2(state, params).await;
let resp = handle_post_2(data.clone(), params).await;
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(