api refactoring

This commit is contained in:
Čarodej
2022-05-11 09:19:55 +02:00
parent d2371e667f
commit c0e431b384
76 changed files with 1142 additions and 690 deletions

View File

@@ -109,26 +109,32 @@ class FixedBillingRestrictionsTest extends TestCase
'name' => 'Company Project',
'invitations' => [
[
'type' => 'invitation',
'email' => 'test@doe.com',
'permission' => 'can-edit',
],
[
'type' => 'invitation',
'email' => 'test2@doe.com',
'permission' => 'can-edit',
],
[
'type' => 'invitation',
'email' => 'test3@doe.com',
'permission' => 'can-edit',
],
[
'type' => 'invitation',
'email' => 'test4@doe.com',
'permission' => 'can-edit',
],
[
'type' => 'invitation',
'email' => 'test5@doe.com',
'permission' => 'can-edit',
],
[
'type' => 'invitation',
'email' => 'test6@doe.com',
'permission' => 'can-edit',
],
@@ -143,6 +149,7 @@ class FixedBillingRestrictionsTest extends TestCase
'name' => 'Company Project',
'invitations' => [
[
'type' => 'invitation',
'email' => $members[0]->email,
'permission' => 'can-edit',
],

View File

@@ -46,7 +46,7 @@ class PersonalAccessTokenTest extends TestCase
$this
->actingAs($user)
->deleteJson("/api/user/tokens/$token_id")
->assertStatus(204);
->assertStatus(200);
$this->assertDatabaseMissing('personal_access_tokens', [
'id' => $token_id,

View File

@@ -309,7 +309,7 @@ class SignFlowTest extends TestCase
$user = User::factory()
->create(['email' => 'john@doe.com']);
$this->postJson('/api/password/email', [
$this->postJson('/api/password/recover', [
'email' => $user->email,
])->assertStatus(200);

View File

@@ -74,7 +74,7 @@ class UserAccountTest extends TestCase
'current' => 'secret',
'password' => 'VerySecretPassword',
'password_confirmation' => 'VerySecretPassword',
])->assertStatus(204);
])->assertStatus(200);
$this
->actingAs($user)
@@ -101,7 +101,7 @@ class UserAccountTest extends TestCase
->patchJson('/api/user/settings', [
'name' => 'address',
'value' => 'Jantar',
])->assertStatus(204);
])->assertStatus(200);
$this->assertDatabaseHas('user_settings', [
'address' => 'Jantar',
@@ -122,9 +122,13 @@ class UserAccountTest extends TestCase
$this
->actingAs($user)
->patchJson('/api/user/settings', [
->postJson('/api/user/avatar', [
'avatar' => $avatar,
])->assertStatus(204);
])
->assertStatus(200)
->assertJsonFragment([
'message' => 'The avatar was successfully updated.',
]);
collect(config('vuefilemanager.avatar_sizes'))
->each(
@@ -246,10 +250,10 @@ class UserAccountTest extends TestCase
'email_verified_at' => null,
]);
$this->postJson('/api/user/email/verify/resend', [
$this->postJson('/api/user/verify', [
'email' => $user->email,
])
->assertStatus(204);
->assertStatus(200);
Notification::assertTimesSent(1, VerifyEmail::class);
}