mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-30 18:34:36 +01:00
Deploying to gh-pages from @ e1f79dae17
🚀
This commit is contained in:
parent
378b4c17ba
commit
04412c5474
@ -775,7 +775,7 @@
|
||||
<span class="macro">assert!</span>(<span class="ident">f</span>.<span class="ident">is_ok</span>());
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">actix_rt::test</span>]</span>
|
||||
<span class="attribute">#[<span class="ident">actix_web::test</span>]</span>
|
||||
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">test_middleware_works_with_app</span>() {
|
||||
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">validator</span>(
|
||||
<span class="ident">_req</span>: <span class="ident">ServiceRequest</span>,
|
||||
@ -788,7 +788,7 @@
|
||||
<span class="kw">let</span> <span class="ident">srv</span> <span class="op">=</span> <span class="ident">actix_web::test::init_service</span>(
|
||||
<span class="ident">App::new</span>()
|
||||
.<span class="ident">wrap</span>(<span class="ident">middleware</span>)
|
||||
.<span class="ident">route</span>(<span class="string">"/"</span>, <span class="ident">web::get</span>().<span class="ident">to</span>(<span class="op">|</span><span class="op">|</span> <span class="ident">web::HttpResponse::Ok</span>())),
|
||||
.<span class="ident">route</span>(<span class="string">"/"</span>, <span class="ident">web::get</span>().<span class="ident">to</span>(<span class="ident">HttpResponse::Ok</span>)),
|
||||
)
|
||||
.<span class="kw">await</span>;
|
||||
|
||||
@ -800,7 +800,7 @@
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">resp</span>.<span class="ident">status</span>(), <span class="ident">StatusCode::UNAUTHORIZED</span>);
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">actix_rt::test</span>]</span>
|
||||
<span class="attribute">#[<span class="ident">actix_web::test</span>]</span>
|
||||
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">test_middleware_works_with_scope</span>() {
|
||||
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">validator</span>(
|
||||
<span class="ident">_req</span>: <span class="ident">ServiceRequest</span>,
|
||||
@ -814,7 +814,7 @@
|
||||
<span class="ident">App::new</span>().<span class="ident">service</span>(
|
||||
<span class="ident">web::scope</span>(<span class="string">"/"</span>)
|
||||
.<span class="ident">wrap</span>(<span class="ident">middleware</span>)
|
||||
.<span class="ident">route</span>(<span class="string">"/"</span>, <span class="ident">web::get</span>().<span class="ident">to</span>(<span class="op">|</span><span class="op">|</span> <span class="ident">web::HttpResponse::Ok</span>())),
|
||||
.<span class="ident">route</span>(<span class="string">"/"</span>, <span class="ident">web::get</span>().<span class="ident">to</span>(<span class="ident">HttpResponse::Ok</span>)),
|
||||
),
|
||||
)
|
||||
.<span class="kw">await</span>;
|
||||
|
Loading…
Reference in New Issue
Block a user