public function test_shelves_shows_in_header_if_have_any_shelve_view_permission()
{
- $user = factory(User::class)->create();
+ $user = User::factory()->create();
$this->giveUserPermissions($user, ['image-create-all']);
$shelf = Bookshelf::first();
$userRole = $user->roles()->first();
$shelf = Bookshelf::first();
$resp = $this->asAdmin()->get($shelf->getUrl('/permissions'));
$resp->assertSeeText('Copy Permissions');
- $resp->assertSee("action=\"{$shelf->getUrl('/copy-permissions')}\"");
+ $resp->assertSee("action=\"{$shelf->getUrl('/copy-permissions')}\"", false);
$child = $shelf->books()->first();
$editorRole = $this->getEditor()->roles()->first();
$resp = $this->asEditor()->get($newBook->getUrl());
$resp->assertDontSee($shelfInfo['name']);
}
+
+ public function test_cancel_on_child_book_creation_returns_to_original_shelf()
+ {
+ /** @var Bookshelf $shelf */
+ $shelf = Bookshelf::query()->first();
+ $resp = $this->asEditor()->get($shelf->getUrl('/create-book'));
+ $resp->assertElementContains('form a[href="' . $shelf->getUrl() . '"]', 'Cancel');
+ }
}