mirror of
https://github.com/actix/examples
synced 2025-02-02 09:39:03 +01:00
parent
d914b1c694
commit
e2f17fc21e
@ -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!(
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user