namespace Tests\Settings;
-use BookStack\Actions\ActivityType;
+use BookStack\Activity\ActivityType;
use BookStack\References\ReferenceStore;
use Tests\TestCase;
public function test_action_runs_reference_regen()
{
$this->mock(ReferenceStore::class)
- ->shouldReceive('updateForAllPages')
+ ->shouldReceive('updateForAll')
->once();
$resp = $this->asAdmin()->post('/settings/maintenance/regenerate-references');
public function test_settings_manage_permission_required()
{
- $editor = $this->getEditor();
+ $editor = $this->users->editor();
$resp = $this->actingAs($editor)->post('/settings/maintenance/regenerate-references');
$this->assertPermissionError($resp);
- $this->giveUserPermissions($editor, ['settings-manage']);
+ $this->permissions->grantUserRolePermissions($editor, ['settings-manage']);
$resp = $this->actingAs($editor)->post('/settings/maintenance/regenerate-references');
$this->assertNotPermissionError($resp);
public function test_action_failed_shown_as_error_notification()
{
$this->mock(ReferenceStore::class)
- ->shouldReceive('updateForAllPages')
+ ->shouldReceive('updateForAll')
->andThrow(\Exception::class, 'A badger stopped the task');
$resp = $this->asAdmin()->post('/settings/maintenance/regenerate-references');