@@ -120,10 +120,10 @@ public function testLoginActionUsernameSuccess(): void
120120 // Change the validation rules
121121 $ config = new class () extends Validation {
122122 public $ login = [
123- 'username ' => 'required|max_length[30]|alpha_numeric_space|min_length[3] ' ,
124123 'password ' => 'required ' ,
125124 ];
126125 };
126+ $ config ->login ['username ' ] = config ('AuthSession ' )->usernameValidationRules ;
127127 Factories::injectMock ('config ' , 'Validation ' , $ config );
128128
129129 $ this ->user ->createEmailIdentity ([
@@ -139,6 +139,8 @@ public function testLoginActionUsernameSuccess(): void
139139 $ result ->assertSessionHas ('user ' , ['id ' => 1 ]);
140140 $ result ->assertStatus (302 );
141141 $ result ->assertRedirect ();
142+ $ result ->assertSessionMissing ('error ' );
143+ $ result ->assertSessionMissing ('errors ' );
142144 $ this ->assertSame (site_url (), $ result ->getRedirectUrl ());
143145
144146 // Login should have been recorded successfully
@@ -191,6 +193,8 @@ public function testLoginRedirectsToActionIfDefined(): void
191193 // Should have been redirected to the action's page.
192194 $ result ->assertStatus (302 );
193195 $ result ->assertRedirect ();
196+ $ result ->assertSessionMissing ('error ' );
197+ $ result ->assertSessionMissing ('errors ' );
194198 $ this ->assertSame (site_url ('auth/a/show ' ), $ result ->getRedirectUrl ());
195199 }
196200}
0 commit comments