X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a6633642232efd164d4708967ab59e498fbff896..refs/pull/2902/head:/tests/AuditLogTest.php diff --git a/tests/AuditLogTest.php b/tests/AuditLogTest.php index 3dc6fd7c2..bc36a184d 100644 --- a/tests/AuditLogTest.php +++ b/tests/AuditLogTest.php @@ -1,17 +1,20 @@ -actingAs( $this->getAdmin()); + $this->actingAs($this->getAdmin()); $page = Page::query()->first(); $pageName = $page->name; $this->activityService->addForEntity($page, ActivityType::PAGE_CREATE); @@ -117,4 +120,24 @@ class AuditLogTest extends TestCase $resp->assertDontSeeText($page->name); } -} \ No newline at end of file + public function test_user_filter() + { + $admin = $this->getAdmin(); + $editor = $this->getEditor(); + $this->actingAs($admin); + $page = Page::query()->first(); + $this->activityService->addForEntity($page, ActivityType::PAGE_CREATE); + + $this->actingAs($editor); + $chapter = Chapter::query()->first(); + $this->activityService->addForEntity($chapter, ActivityType::CHAPTER_UPDATE); + + $resp = $this->actingAs($admin)->get('settings/audit?user=' . $admin->id); + $resp->assertSeeText($page->name); + $resp->assertDontSeeText($chapter->name); + + $resp = $this->actingAs($admin)->get('settings/audit?user=' . $editor->id); + $resp->assertSeeText($chapter->name); + $resp->assertDontSeeText($page->name); + } +}