Skip to content

Commit

Permalink
fix: TwoFactorControllerTest
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 1d056c1 commit abd36ad
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)->deleteJson('/api/client/account/two-factor', [
$response = $this->actingAs($user)->postJson('/api/client/account/two-factor', [
'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)->deleteJson('/api/client/account/two-factor', [
$response = $this->actingAs($user)->postJson('/api/client/account/two-factor', [
'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)->deleteJson('/api/client/account/two-factor', [
$response = $this->actingAs($user)->postJson('/api/client/account/two-factor', [
'password' => 'password',
]);

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

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

0 comments on commit abd36ad

Please sign in to comment.