Updated auditlog IP search test

To ensure the test covers filtering logic.
Related to #3081.
This commit is contained in:
Dan Brown 2021-12-18 11:05:41 +00:00
parent 5c04f25c86
commit 04d59763c3
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -180,8 +180,16 @@ class AuditLogTest extends TestCase
'X-Forwarded-For' => '192.123.45.1', 'X-Forwarded-For' => '192.123.45.1',
])->assertRedirect($page->refresh()->getUrl()); ])->assertRedirect($page->refresh()->getUrl());
$this->actingAs($editor)->put($page->getUrl(), [
'name' => 'Updated page',
'html' => '<p>Updated content</p>',
], [
'X-Forwarded-For' => '192.122.45.1',
])->assertRedirect($page->refresh()->getUrl());
$resp = $this->asAdmin()->get('/settings/audit?&ip=192.123'); $resp = $this->asAdmin()->get('/settings/audit?&ip=192.123');
$resp->assertSee('192.123.45.1'); $resp->assertSee('192.123.45.1');
$resp->assertDontSee('192.122.45.1');
} }
public function test_ip_address_not_logged_in_demo_mode() public function test_ip_address_not_logged_in_demo_mode()