mirror of
https://github.com/archtechx/laravel-pages.git
synced 2025-12-12 09:54:03 +00:00
Add password protected pages (resolve #3)
This commit is contained in:
parent
e9d1cd6fe7
commit
c0c4ebe0d0
5 changed files with 23 additions and 4 deletions
|
|
@ -77,3 +77,16 @@ test('SEO metadata is set on markdown pages', function () {
|
|||
->assertSee('<meta property="og:title" content="Test page" />', false)
|
||||
->assertSee('<meta property="og:description" content="This is a test page" />', false);
|
||||
});
|
||||
|
||||
test('pages can be password-protected', function () {
|
||||
Page::create([
|
||||
'slug' => 'test',
|
||||
'title' => 'Test page',
|
||||
'password' => 'foo',
|
||||
'content' => 'This is a test page'
|
||||
]);
|
||||
|
||||
using($this)->get('/test')->assertForbidden();
|
||||
using($this)->get('/test?password=bar')->assertForbidden();
|
||||
using($this)->get('/test?password=foo')->assertSuccessful()->assertSee('This is a test page');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue