setLocale($locale); $html = View::make("errors.{$code}")->render(); expect($html) ->toContain((string) $code) ->not->toContain("errors.{$code}.") // The generic catch: any unresolved key of ours has this shape. ->not->toMatch('/errors\.\d{3}\./'); } })->with($codes); it('shows a hint where there is one and nothing where there is not', function () { app()->setLocale('de'); // 419 has a hint in the lang file; 404 deliberately does not. Asserted on // the element, not on the word: "hint" is also the CSS class that styles it. expect(View::make('errors.419')->render()) ->toContain(__('errors.419.hint')) ->toContain('
'); $html = View::make('errors.404')->render(); expect($html)->toContain(__('errors.404.title')) ->and($html)->not->toContain('
'); }); it('serves a real 404 through the stack', function () { // The view rendering above cannot catch a broken error handler. $this->get('/definitely-not-a-route') ->assertNotFound() ->assertSee(__('errors.404.title')) ->assertDontSee('errors.404.'); });