mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-05 01:24:38 +08:00
@ -4,6 +4,7 @@ use BookStack\Actions\Activity;
|
||||
use BookStack\Actions\ActivityService;
|
||||
use BookStack\Actions\ActivityType;
|
||||
use BookStack\Auth\UserRepo;
|
||||
use BookStack\Entities\Models\Chapter;
|
||||
use BookStack\Entities\Tools\TrashCan;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Entities\Repos\PageRepo;
|
||||
@ -117,4 +118,26 @@ class AuditLogTest extends TestCase
|
||||
$resp->assertDontSeeText($page->name);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user