Fixed error on image deletion

Also Added tests to cover image upload and deletion.
Fixes #136.
This commit is contained in:
Dan Brown
2016-07-01 20:11:49 +01:00
parent 361ba8b244
commit 7b6c88f17c
7 changed files with 124 additions and 13 deletions

View File

@ -39,11 +39,19 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
*/
public function asAdmin()
{
return $this->actingAs($this->getAdmin());
}
/**
* Get the current admin user.
* @return mixed
*/
public function getAdmin() {
if($this->admin === null) {
$adminRole = \BookStack\Role::getRole('admin');
$this->admin = $adminRole->users->first();
}
return $this->actingAs($this->admin);
return $this->admin;
}
/**