+ public function test_public_view_then_login_redirects_to_previous_content()
+ {
+ $this->setSettings(['app-public' => 'true']);
+ $book = Book::query()->first();
+ $this->visit($book->getUrl())
+ ->see($book->name)
+ ->visit('/login')
+ ->type('password', '#password')
+ ->press('Log In')
+ ->seePageUrlIs($book->getUrl());
+ }
+
+ public function test_access_hidden_content_then_login_redirects_to_intended_content()
+ {
+ $this->setSettings(['app-public' => 'true']);
+ $book = Book::query()->first();
+ $this->setEntityRestrictions($book);
+
+ try {
+ $this->visit($book->getUrl());
+ } catch (\Exception $exception) {}
+
+ $this->see('Book not found')
+ ->dontSee($book->name)
+ ->visit('/login')
+ ->type('password', '#password')
+ ->press('Log In')
+ ->seePageUrlIs($book->getUrl())
+ ->see($book->name);
+ }