File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
crates/handlers/src/views Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -498,7 +498,7 @@ mod tests {
498498 }
499499
500500 #[ sqlx:: test( migrator = "mas_storage_pg::MIGRATOR" ) ]
501- async fn test_register_username_too_short ( pool : PgPool ) {
501+ async fn test_register_username_too_long ( pool : PgPool ) {
502502 setup ( ) ;
503503 let state = TestState :: from_pool ( pool) . await . unwrap ( ) ;
504504 let cookies = CookieHelper :: new ( ) ;
@@ -524,7 +524,7 @@ mod tests {
524524 let request = Request :: post ( & * mas_router:: Register :: default ( ) . path_and_query ( ) ) . form (
525525 serde_json:: json!( {
526526 "csrf" : csrf_token,
527- "username" : "" ,
527+ "username" : "a" . repeat ( 256 ) ,
528528529529 "password" : "hunter2" ,
530530 "password_confirm" : "hunter2" ,
@@ -535,7 +535,11 @@ mod tests {
535535 let response = state. request ( request) . await ;
536536 cookies. save_cookies ( & response) ;
537537 response. assert_status ( StatusCode :: OK ) ;
538- assert ! ( response. body( ) . contains( "username too short" ) ) ;
538+ assert ! (
539+ response. body( ) . contains( "Username is too long" ) ,
540+ "response body: {}" ,
541+ response. body( )
542+ ) ;
539543 }
540544
541545 /// When the user already exists in the database, it should give an error
You can’t perform that action at this time.
0 commit comments