Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 23305ae

Browse files
Add tests for root URL with trailing slash
1 parent 9f0397d commit 23305ae

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

‎app/Http/routes.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
|
1212
*/
1313

14-
Route::get('/', 'HomeController@index');
14+
Route::get('/', ['as' => 'homepage', 'uses' => 'HomeController@index']);
1515
Route::get('flash', 'HomeController@flash');
1616
Route::get('back', 'HomeController@back');
1717
Route::get('secure', 'HomeController@secure');

‎tests/functional/RoutesCest.php‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,19 @@ public function openRouteWithDomainSpecified(FunctionalTester $I)
2424
$I->see('Domain route');
2525
}
2626

27+
public function routesWitTrailingSlashes(FunctionalTester $I)
28+
{
29+
$I->amOnPage('/');
30+
$I->seeCurrentRouteIs('homepage');
31+
32+
$I->amOnRoute('homepage');
33+
$I->seeCurrentRouteIs('homepage');
34+
35+
$I->amOnPage('/posts');
36+
$I->seeCurrentRouteIs('posts.index');
37+
38+
$I->amOnRoute('posts.index');
39+
$I->seeCurrentRouteIs('posts.index');
40+
}
41+
2742
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /