Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions resources/js/components/app-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import AppLogoIcon from './app-logo-icon';
const mainNavItems: NavItem[] = [
{
title: 'Dashboard',
url: '/dashboard',
url: route('dashboard'),
icon: LayoutGrid,
},
];
Expand Down Expand Up @@ -94,7 +94,7 @@ export function AppHeader({ breadcrumbs = [] }: AppHeaderProps) {
</Sheet>
</div>

<Link href="/dashboard" prefetch className="flex items-center space-x-2">
<Link href={route('dashboard')} prefetch className="flex items-center space-x-2">
<AppLogo />
</Link>

Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/app-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import AppLogo from './app-logo';
const mainNavItems: NavItem[] = [
{
title: 'Dashboard',
url: '/dashboard',
url: route('dashboard'),
icon: LayoutGrid,
},
];
Expand All @@ -35,7 +35,7 @@ export function AppSidebar() {
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton size="lg" asChild>
<Link href="/dashboard" prefetch>
<Link href={route('dashboard')} prefetch>
<AppLogo />
</Link>
</SidebarMenuButton>
Expand Down
6 changes: 3 additions & 3 deletions resources/js/layouts/settings/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import { Link } from '@inertiajs/react';
const sidebarNavItems: NavItem[] = [
{
title: 'Profile',
url: '/settings/profile',
url: route('profile.edit'),
icon: null,
},
{
title: 'Password',
url: '/settings/password',
url: route('password.edit'),
icon: null,
},
{
title: 'Appearance',
url: '/settings/appearance',
url: route('appearance'),
icon: null,
},
];
Expand Down
2 changes: 1 addition & 1 deletion resources/js/pages/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Head } from '@inertiajs/react';
const breadcrumbs: BreadcrumbItem[] = [
{
title: 'Dashboard',
href: '/dashboard',
href: route('dashboard'),
},
];

Expand Down
6 changes: 4 additions & 2 deletions routes/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
Route::get('register', [RegisteredUserController::class, 'create'])
->name('register');

Route::post('register', [RegisteredUserController::class, 'store']);
Route::post('register', [RegisteredUserController::class, 'store'])
->name('register.store');

Route::get('login', [AuthenticatedSessionController::class, 'create'])
->name('login');
Expand Down Expand Up @@ -49,7 +50,8 @@
Route::get('confirm-password', [ConfirmablePasswordController::class, 'show'])
->name('password.confirm');

Route::post('confirm-password', [ConfirmablePasswordController::class, 'store']);
Route::post('confirm-password', [ConfirmablePasswordController::class, 'store'])
->name('password.confirmation');

Route::post('logout', [AuthenticatedSessionController::class, 'destroy'])
->name('logout');
Expand Down
8 changes: 4 additions & 4 deletions tests/Feature/Auth/AuthenticationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AuthenticationTest extends TestCase

public function test_login_screen_can_be_rendered()
{
$response = $this->get('/login');
$response = $this->get(route('login'));

$response->assertStatus(200);
}
Expand All @@ -21,7 +21,7 @@ public function test_users_can_authenticate_using_the_login_screen()
{
$user = User::factory()->create();

$response = $this->post('/login', [
$response = $this->post(route('login'), [
'email' => $user->email,
'password' => 'password',
]);
Expand All @@ -34,7 +34,7 @@ public function test_users_can_not_authenticate_with_invalid_password()
{
$user = User::factory()->create();

$this->post('/login', [
$this->post(route('login'), [
'email' => $user->email,
'password' => 'wrong-password',
]);
Expand All @@ -46,7 +46,7 @@ public function test_users_can_logout()
{
$user = User::factory()->create();

$response = $this->actingAs($user)->post('/logout');
$response = $this->actingAs($user)->post(route('logout'));

$this->assertGuest();
$response->assertRedirect('/');
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Auth/EmailVerificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function test_email_verification_screen_can_be_rendered()
{
$user = User::factory()->unverified()->create();

$response = $this->actingAs($user)->get('/verify-email');
$response = $this->actingAs($user)->get(route('verification.notice'));

$response->assertStatus(200);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Feature/Auth/PasswordConfirmationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function test_confirm_password_screen_can_be_rendered()
{
$user = User::factory()->create();

$response = $this->actingAs($user)->get('/confirm-password');
$response = $this->actingAs($user)->get(route('password.confirm'));

$response->assertStatus(200);
}
Expand All @@ -23,7 +23,7 @@ public function test_password_can_be_confirmed()
{
$user = User::factory()->create();

$response = $this->actingAs($user)->post('/confirm-password', [
$response = $this->actingAs($user)->post(route('password.confirmation'), [
'password' => 'password',
]);

Expand All @@ -35,7 +35,7 @@ public function test_password_is_not_confirmed_with_invalid_password()
{
$user = User::factory()->create();

$response = $this->actingAs($user)->post('/confirm-password', [
$response = $this->actingAs($user)->post(route('password.confirmation'), [
'password' => 'wrong-password',
]);

Expand Down
10 changes: 5 additions & 5 deletions tests/Feature/Auth/PasswordResetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PasswordResetTest extends TestCase

public function test_reset_password_link_screen_can_be_rendered()
{
$response = $this->get('/forgot-password');
$response = $this->get(route('password.request'));

$response->assertStatus(200);
}
Expand All @@ -25,7 +25,7 @@ public function test_reset_password_link_can_be_requested()

$user = User::factory()->create();

$this->post('/forgot-password', ['email' => $user->email]);
$this->post(route('password.email'), ['email' => $user->email]);

Notification::assertSentTo($user, ResetPassword::class);
}
Expand All @@ -36,7 +36,7 @@ public function test_reset_password_screen_can_be_rendered()

$user = User::factory()->create();

$this->post('/forgot-password', ['email' => $user->email]);
$this->post(route('password.email'), ['email' => $user->email]);

Notification::assertSentTo($user, ResetPassword::class, function ($notification) {
$response = $this->get('/reset-password/'.$notification->token);
Expand All @@ -53,10 +53,10 @@ public function test_password_can_be_reset_with_valid_token()

$user = User::factory()->create();

$this->post('/forgot-password', ['email' => $user->email]);
$this->post(route('password.email'), ['email' => $user->email]);

Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user) {
$response = $this->post('/reset-password', [
$response = $this->post(route('password.store'), [
'token' => $notification->token,
'email' => $user->email,
'password' => 'password',
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/Auth/RegistrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ class RegistrationTest extends TestCase

public function test_registration_screen_can_be_rendered()
{
$response = $this->get('/register');
$response = $this->get(route('register'));

$response->assertStatus(200);
}

public function test_new_users_can_register()
{
$response = $this->post('/register', [
$response = $this->post(route('register.store'), [
'name' => 'Test User',
'email' => '[email protected]',
'password' => 'password',
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/DashboardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ class DashboardTest extends TestCase

public function test_guests_are_redirected_to_the_login_page()
{
$this->get('/dashboard')->assertRedirect('/login');
$this->get(route('dashboard'))->assertRedirect('/login');
}

public function test_authenticated_users_can_visit_the_dashboard()
{
$this->actingAs($user = User::factory()->create());

$this->get('/dashboard')->assertOk();
$this->get(route('dashboard'))->assertOk();
}
}
12 changes: 6 additions & 6 deletions tests/Feature/Settings/PasswordUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ public function test_password_can_be_updated()

$response = $this
->actingAs($user)
->from('/settings/password')
->put('/settings/password', [
->from(route('password.edit'))
->put(route('password.update'), [
'current_password' => 'password',
'password' => 'new-password',
'password_confirmation' => 'new-password',
]);

$response
->assertSessionHasNoErrors()
->assertRedirect('/settings/password');
->assertRedirect(route('password.edit'));

$this->assertTrue(Hash::check('new-password', $user->refresh()->password));
}
Expand All @@ -37,15 +37,15 @@ public function test_correct_password_must_be_provided_to_update_password()

$response = $this
->actingAs($user)
->from('/settings/password')
->put('/settings/password', [
->from(route('password.edit'))
->put(route('password.update'), [
'current_password' => 'wrong-password',
'password' => 'new-password',
'password_confirmation' => 'new-password',
]);

$response
->assertSessionHasErrors('current_password')
->assertRedirect('/settings/password');
->assertRedirect(route('password.edit'));
}
}
16 changes: 8 additions & 8 deletions tests/Feature/Settings/ProfileUpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public function test_profile_information_can_be_updated()

$response = $this
->actingAs($user)
->patch('/settings/profile', [
->patch(route('profile.update'), [
'name' => 'Test User',
'email' => '[email protected]',
]);

$response
->assertSessionHasNoErrors()
->assertRedirect('/settings/profile');
->assertRedirect(route('profile.edit'));

$user->refresh();

Expand All @@ -49,14 +49,14 @@ public function test_email_verification_status_is_unchanged_when_the_email_addre

$response = $this
->actingAs($user)
->patch('/settings/profile', [
->patch(route('profile.update'), [
'name' => 'Test User',
'email' => $user->email,
]);

$response
->assertSessionHasNoErrors()
->assertRedirect('/settings/profile');
->assertRedirect(route('profile.edit'));

$this->assertNotNull($user->refresh()->email_verified_at);
}
Expand All @@ -67,7 +67,7 @@ public function test_user_can_delete_their_account()

$response = $this
->actingAs($user)
->delete('/settings/profile', [
->delete(route('profile.destroy'), [
'password' => 'password',
]);

Expand All @@ -85,14 +85,14 @@ public function test_correct_password_must_be_provided_to_delete_account()

$response = $this
->actingAs($user)
->from('/settings/profile')
->delete('/settings/profile', [
->from(route('profile.edit'))
->delete(route('profile.destroy'), [
'password' => 'wrong-password',
]);

$response
->assertSessionHasErrors('password')
->assertRedirect('/settings/profile');
->assertRedirect(route('profile.edit'));

$this->assertNotNull($user->fresh());
}
Expand Down