1
0
mirror of https://github.com/actix/examples synced 2025-02-02 09:39:03 +01: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

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

View File

@ -4,4 +4,4 @@ This is an example of how to use Actix Web with the [Handlebars templating langu
- http://localhost:8080 - http://localhost:8080
- http://localhost:8080/Emma/documents - http://localhost:8080/Emma/documents
- http://localhost:8080/Bob/passwordds - http://localhost:8080/Bob/passwords