Skip to content

Commit

Permalink
fix: TwoFactorControllerTest, again
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Penner <[email protected]>
  • Loading branch information
matthewpi committed Oct 24, 2024
1 parent abd36ad commit caab056
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/Integration/Api/Client/TwoFactorControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ public function testTwoFactorCanBeDisabledOnAccount()
/** @var User $user */
$user = User::factory()->create(['use_totp' => true]);

$response = $this->actingAs($user)->postJson('/api/client/account/two-factor', [
$response = $this->actingAs($user)->postJson('/api/client/account/two-factor/disable', [
'password' => 'invalid',
]);

$response->assertStatus(Response::HTTP_BAD_REQUEST);
$response->assertJsonPath('errors.0.code', 'BadRequestHttpException');
$response->assertJsonPath('errors.0.detail', 'The password provided was not valid.');

$response = $this->actingAs($user)->postJson('/api/client/account/two-factor', [
$response = $this->actingAs($user)->postJson('/api/client/account/two-factor/disable', [
'password' => 'password',
]);

Expand All @@ -163,7 +163,7 @@ public function testNoErrorIsReturnedIfTwoFactorIsNotEnabled()
/** @var User $user */
$user = User::factory()->create(['use_totp' => false]);

$response = $this->actingAs($user)->postJson('/api/client/account/two-factor', [
$response = $this->actingAs($user)->postJson('/api/client/account/two-factor/disable', [
'password' => 'password',
]);

Expand Down Expand Up @@ -196,7 +196,7 @@ public function testDisablingTwoFactorRequiresValidPassword()
$user = User::factory()->create(['use_totp' => true]);

$this->actingAs($user)
->postJson('/api/client/account/two-factor', [
->postJson('/api/client/account/two-factor/disable', [
'password' => 'foo',
])
->assertStatus(Response::HTTP_BAD_REQUEST)
Expand Down

0 comments on commit caab056

Please sign in to comment.