namespace Tests;
-use BookStack\Auth\Permissions\JointPermissionBuilder;
use BookStack\Auth\Permissions\RolePermission;
use BookStack\Auth\Role;
use BookStack\Auth\User;
foreach (RolePermission::all() as $perm) {
$publicRole->attachPermission($perm);
}
- $this->app->make(JointPermissionBuilder::class)->rebuildForRole($publicRole);
user()->clearPermissionCache();
$chapter = $this->entities->chapter();
$this->get('/robots.txt')->assertSee("User-agent: *\nDisallow: /");
}
+ public function test_default_favicon_file_created_upon_access()
+ {
+ $faviconPath = public_path('favicon.ico');
+ if (file_exists($faviconPath)) {
+ unlink($faviconPath);
+ }
+
+ $this->assertFileDoesNotExist($faviconPath);
+ $this->get('/favicon.ico');
+ $this->assertFileExists($faviconPath);
+ }
+
public function test_public_view_then_login_redirects_to_previous_content()
{
$this->setSettings(['app-public' => 'true']);
{
$this->setSettings(['app-public' => 'true']);
$book = $this->entities->book();
- $this->entities->setPermissions($book);
+ $this->permissions->setEntityPermissions($book);
$resp = $this->get($book->getUrl());
$resp->assertSee('Book not found');