diff --git a/routes/web.php b/routes/web.php index 4b6f3892..8b40c269 100644 --- a/routes/web.php +++ b/routes/web.php @@ -206,26 +206,8 @@ Route::prefix('{edition}')->whereIn('edition', SetEdition::EDITIONS)->group(func }); // --------------------------------------------------------------------------- -// Sprach-/Edition-unabhängige Routen (Dev-Varianten, API-Doku). +// Sprach-/Edition-unabhängige Routen (API-Doku). // --------------------------------------------------------------------------- -Route::get('/variant-1', function () { - $domain = request()->getHost(); - if (str_contains($domain, 'presseecho')) { - return view('web.presseecho'); - } - - return view('web.businessportal24-variant-float-glow'); -})->name('variant-1'); - -Route::get('/variant-2', function () { - $domain = request()->getHost(); - if (str_contains($domain, 'presseecho')) { - return view('web.presseecho'); - } - - return view('web.businessportal24-variant-glass-gradient'); -}); - Route::get('/docs/api/v1', function () { return response((string) file_get_contents(base_path('docs/api/v1.yml')), 200, [ 'Content-Type' => 'application/yaml; charset=UTF-8', diff --git a/tests/Feature/Web/DevExampleRoutesTest.php b/tests/Feature/Web/DevExampleRoutesTest.php index b46239fd..015d7047 100644 --- a/tests/Feature/Web/DevExampleRoutesTest.php +++ b/tests/Feature/Web/DevExampleRoutesTest.php @@ -1,7 +1,14 @@ get('/'); +use Illuminate\Support\Facades\Route; +use Tests\TestCase; - $response->assertStatus(200); +test('dev variant routes are removed', function () { + expect(Route::has('variant-1'))->toBeFalse(); + + /** @var TestCase $this */ + $this->get('https://businessportal24.test/variant-1')->assertNotFound(); + $this->get('https://businessportal24.test/variant-2')->assertNotFound(); + $this->get('https://presseecho.test/variant-1')->assertNotFound(); + $this->get('https://presseecho.test/variant-2')->assertNotFound(); });