@@ -15,9 +15,8 @@ use crate::{
1515 storage:: { AsyncStorage , Storage , StorageKind } ,
1616 test:: test_metrics:: CollectedMetrics ,
1717 web:: {
18- build_axum_app,
19- cache:: { self } ,
20- headers:: { IfNoneMatch , SURROGATE_CONTROL } ,
18+ build_axum_app, cache,
19+ headers:: { IfNoneMatch , SURROGATE_CONTROL , SurrogateKeys } ,
2120 page:: TemplateData ,
2221 } ,
2322} ;
@@ -75,6 +74,11 @@ pub(crate) fn assert_cache_headers_eq(
7574 response. headers( ) . get( & SURROGATE_CONTROL ) ,
7675 "surrogate control header mismatch"
7776 ) ;
77+ assert_eq ! (
78+ expected_headers. surrogate_keys. as_ref( ) ,
79+ response. headers( ) . typed_get:: <SurrogateKeys >( ) . as_ref( ) ,
80+ "surrogate key header mismatch"
81+ ) ;
7882}
7983
8084pub ( crate ) trait AxumResponseTestExt {
@@ -106,7 +110,7 @@ impl AxumResponseTestExt for axum::response::Response {
106110 assert ! ( config. cache_control_stale_while_revalidate. is_some( ) ) ;
107111
108112 // This method is only about asserting if the handler did set the right _policy_.
109- assert_cache_headers_eq ( self , & cache_policy. render ( config) ) ;
113+ assert_cache_headers_eq ( self , & cache_policy. render ( config) . unwrap ( ) ) ;
110114 }
111115
112116 fn error_for_status ( self ) -> Result < Self >
0 commit comments