mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
Add unit test for ip addess searching
This commit is contained in:
parent
e6e92618b1
commit
7d13666039
@ -166,6 +166,24 @@ class AuditLogTest extends TestCase
|
|||||||
$resp->assertSee('192.123.45.1');
|
$resp->assertSee('192.123.45.1');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_ip_address_is_searchable()
|
||||||
|
{
|
||||||
|
config()->set('app.proxies', '*');
|
||||||
|
$editor = $this->getEditor();
|
||||||
|
/** @var Page $page */
|
||||||
|
$page = Page::query()->first();
|
||||||
|
|
||||||
|
$this->actingAs($editor)->put($page->getUrl(), [
|
||||||
|
'name' => 'Updated page',
|
||||||
|
'html' => '<p>Updated content</p>',
|
||||||
|
], [
|
||||||
|
'X-Forwarded-For' => '192.123.45.1',
|
||||||
|
])->assertRedirect($page->refresh()->getUrl());
|
||||||
|
|
||||||
|
$resp = $this->asAdmin()->get('/settings/audit?&ip=192.123');
|
||||||
|
$resp->assertSee('192.123.45.1');
|
||||||
|
}
|
||||||
|
|
||||||
public function test_ip_address_not_logged_in_demo_mode()
|
public function test_ip_address_not_logged_in_demo_mode()
|
||||||
{
|
{
|
||||||
config()->set('app.proxies', '*');
|
config()->set('app.proxies', '*');
|
||||||
|
Loading…
Reference in New Issue
Block a user