diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php index 4bc69303..18392a51 100644 --- a/resources/lang/en/auth.php +++ b/resources/lang/en/auth.php @@ -2,7 +2,7 @@ return [ 'auth-needed-screen' => [ - 'title' => 'Authentication requred', + 'title' => 'Authentication required', 'text' => 'Please authenticate in order to access your appeal.', 'key-text' => 'Please enter your appeal key in the text box', 'key-placeholder' => 'Appeal key here', diff --git a/routes/web.php b/routes/web.php index 15df43f7..9279b72e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -30,7 +30,7 @@ Route::post('/appeal/verify/{appeal}', 'Appeal\PublicAppealController@verifyAccountOwnership')->name('public.appeal.verifyownership.submit'); }); -Route::get('/appeal/{id}', 'AppealController@appeal')->middleware('auth')->name('appeal.view'); +Route::get('/appeal/{id}', 'AppealController@appeal')->name('appeal.view'); Route::get('/review', 'AppealController@appeallist')->name('appeal.list'); Route::get('/locate', 'AppealController@search')->name('appeal.search'); diff --git a/tests/Feature/Appeal/AppealLoginPageTest.php b/tests/Feature/Appeal/AppealLoginPageTest.php new file mode 100644 index 00000000..6f4c360f --- /dev/null +++ b/tests/Feature/Appeal/AppealLoginPageTest.php @@ -0,0 +1,40 @@ +create(); + $user = $this->getUser(); + + $response = $this + ->actingAs($user) + ->get(route('appeal.view', $appeal)); + + $response + ->assertSee('Appeal for ') + ->assertDontSee('Authentication required'); + } + + public function test_logged_out_user_does_see_login_page() + { + $appeal = Appeal::factory()->create(); + + $response = $this + ->get(route('appeal.view', $appeal)); + + $response + ->assertDontSee('Appeal for ') + ->assertSee('Authentication required'); + } +}