diff --git a/src/Application.php b/src/Application.php index 06475057..d4cf13d1 100644 --- a/src/Application.php +++ b/src/Application.php @@ -38,7 +38,6 @@ public function __construct() \Minz\Output\View::$extensions_to_content_types['.atom.xml.php'] = 'application/xml'; \Minz\Output\View::$extensions_to_content_types['.opml.xml.php'] = 'text/x-opml'; - \Minz\Output\View::$extensions_to_content_types['.turbo_stream.phtml'] = 'text/vnd.turbo-stream.html'; \Minz\Output\View::$extensions_to_content_types['.xsl.php'] = 'application/xslt+xml'; } @@ -133,7 +132,7 @@ public function run($request) 'autoload_modal_url' => $autoload_modal_url, 'now' => \Minz\Time::now(), 'javascript_configuration' => json_encode(include('utils/javascript_configuration.php')), - 'turbo_frame' => $request->header('HTTP_TURBO_FRAME'), + 'modal_requested' => $request->header('HTTP_TURBO_FRAME') === 'modal-content', 'demo' => $app_conf['demo'], 'registrations_opened' => $app_conf['registrations_opened'], ]); diff --git a/src/assets/javascripts/controllers/modal_controller.js b/src/assets/javascripts/controllers/modal_controller.js index 5016abf9..adeb0ec8 100644 --- a/src/assets/javascripts/controllers/modal_controller.js +++ b/src/assets/javascripts/controllers/modal_controller.js @@ -23,6 +23,11 @@ export default class extends Controller { } connect () { + // Set the id of the content turbo-frame. It must not be set directly + // in the HTML, or Turbo will try to load its content when a form in + // the modal redirects to a new page (instead of showing the full HTML). + this.contentTarget.setAttribute('id', 'modal-content'); + this.element.addEventListener('open-modal', this.open.bind(this)); // handle modal shortcuts diff --git a/src/controllers/Feeds.php b/src/controllers/Feeds.php index f11898e2..d5f05cb5 100644 --- a/src/controllers/Feeds.php +++ b/src/controllers/Feeds.php @@ -99,18 +99,8 @@ public function create($request) return Response::redirect('login', ['redirect_to' => $from]); } - if ($request->isAccepting('text/vnd.turbo-stream.html')) { - // This allows to display the errors within the modal instead of - // sending a whole new page. This is a bit hacky so I'm going - // to use this method only where absolutely needed. - // @see https://github.com/hotwired/turbo/issues/138#issuecomment-847699281 - $view_file = 'feeds/new.turbo_stream.phtml'; - } else { - $view_file = 'feeds/new.phtml'; - } - if (!\Minz\CSRF::validate($csrf)) { - return Response::badRequest($view_file, [ + return Response::badRequest('feeds/new.phtml', [ 'url' => $url, 'from' => $from, 'error' => _('A security verification failed: you should retry to submit the form.'), @@ -127,7 +117,7 @@ public function create($request) $errors = $default_link->validate(); if ($errors) { - return Response::badRequest($view_file, [ + return Response::badRequest('feeds/new.phtml', [ 'url' => $url, 'from' => $from, 'errors' => $errors, @@ -142,7 +132,7 @@ public function create($request) $feed_urls = $default_link->feedUrls(); if (count($feed_urls) === 0) { - return Response::badRequest($view_file, [ + return Response::badRequest('feeds/new.phtml', [ 'url' => $url, 'from' => $from, 'errors' => [ diff --git a/src/controllers/collections/Shares.php b/src/controllers/collections/Shares.php index d99c3122..bf9541cd 100644 --- a/src/controllers/collections/Shares.php +++ b/src/controllers/collections/Shares.php @@ -74,16 +74,6 @@ public function create($request) ]); } - if ($request->isAccepting('text/vnd.turbo-stream.html')) { - // This allows to display the errors within the modal instead of - // sending a whole new page. This is a bit hacky so I'm going - // to use this method only where absolutely needed. - // @see https://github.com/hotwired/turbo/issues/138#issuecomment-847699281 - $view_file = 'collections/shares/index.turbo_stream.phtml'; - } else { - $view_file = 'collections/shares/index.phtml'; - } - $collection_id = $request->param('id'); $user_id = $request->param('user_id'); $type = $request->param('type'); @@ -99,7 +89,7 @@ public function create($request) } if (!\Minz\CSRF::validate($csrf)) { - return Response::badRequest($view_file, [ + return Response::badRequest('collections/shares/index.phtml', [ 'collection' => $collection, 'from' => $from, 'type' => $type, @@ -109,7 +99,7 @@ public function create($request) } if ($current_user->id === $user_id) { - return Response::badRequest($view_file, [ + return Response::badRequest('collections/shares/index.phtml', [ 'collection' => $collection, 'from' => $from, 'type' => $type, @@ -125,7 +115,7 @@ public function create($request) !models\User::exists($user_id) || $support_user->id === $user_id ) { - return Response::badRequest($view_file, [ + return Response::badRequest('collections/shares/index.phtml', [ 'collection' => $collection, 'from' => $from, 'type' => $type, @@ -141,7 +131,7 @@ public function create($request) 'user_id' => $user_id, ]); if ($existing_collection_share) { - return Response::badRequest($view_file, [ + return Response::badRequest('collections/shares/index.phtml', [ 'collection' => $collection, 'from' => $from, 'type' => $type, @@ -155,7 +145,7 @@ public function create($request) $collection_share = models\CollectionShare::init($user_id, $collection->id, $type); $errors = $collection_share->validate(); if ($errors) { - return Response::badRequest($view_file, [ + return Response::badRequest('collections/shares/index.phtml', [ 'collection' => $collection, 'from' => $from, 'type' => $type, @@ -166,7 +156,7 @@ public function create($request) $collection_share->save(); - return Response::ok($view_file, [ + return Response::ok('collections/shares/index.phtml', [ 'collection' => $collection, 'from' => $from, 'type' => 'read', @@ -198,16 +188,6 @@ public function delete($request) ]); } - if ($request->isAccepting('text/vnd.turbo-stream.html')) { - // This allows to display the errors within the modal instead of - // sending a whole new page. This is a bit hacky so I'm going - // to use this method only where absolutely needed. - // @see https://github.com/hotwired/turbo/issues/138#issuecomment-847699281 - $view_file = 'collections/shares/index.turbo_stream.phtml'; - } else { - $view_file = 'collections/shares/index.phtml'; - } - $csrf = $request->param('csrf'); $collection_share_id = $request->paramInteger('id'); $collection_share = models\CollectionShare::find($collection_share_id); @@ -222,7 +202,7 @@ public function delete($request) } if (!\Minz\CSRF::validate($csrf)) { - return Response::badRequest($view_file, [ + return Response::badRequest('collections/shares/index.phtml', [ 'collection' => $collection, 'from' => $from, 'type' => 'read', @@ -233,7 +213,7 @@ public function delete($request) models\CollectionShare::delete($collection_share->id); - return Response::ok($view_file, [ + return Response::ok('collections/shares/index.phtml', [ 'collection' => $collection, 'from' => $from, 'type' => 'read', diff --git a/src/controllers/links/Repairing.php b/src/controllers/links/Repairing.php index 3605a326..32b95784 100644 --- a/src/controllers/links/Repairing.php +++ b/src/controllers/links/Repairing.php @@ -89,18 +89,8 @@ public function create($request) return Response::notFound('not_found.phtml'); } - if ($request->isAccepting('text/vnd.turbo-stream.html')) { - // This allows to display the errors within the modal instead of - // sending a whole new page. This is a bit hacky so I'm going - // to use this method only where absolutely needed. - // @see https://github.com/hotwired/turbo/issues/138#issuecomment-847699281 - $view_file = 'links/repairing/new.turbo_stream.phtml'; - } else { - $view_file = 'links/repairing/new.phtml'; - } - if (!\Minz\CSRF::validate($csrf)) { - return Response::badRequest($view_file, [ + return Response::badRequest('links/repairing/new.phtml', [ 'link' => $link, 'url' => $url, 'url_cleared' => $url_cleared, @@ -115,7 +105,7 @@ public function create($request) $link->url = \SpiderBits\Url::sanitize($url); $errors = $link->validate(); if ($errors) { - return Response::badRequest($view_file, [ + return Response::badRequest('links/repairing/new.phtml', [ 'link' => $link, 'url' => $url, 'url_cleared' => $url_cleared, diff --git a/src/views/_layouts/base.phtml b/src/views/_layouts/base.phtml index ac466ef0..322cd0d5 100644 --- a/src/views/_layouts/base.phtml +++ b/src/views/_layouts/base.phtml @@ -1,6 +1,7 @@ isBlocked()) { $layout_name = 'connected.phtml'; } elseif ($current_user) { diff --git a/src/views/_layouts/connected.phtml b/src/views/_layouts/connected.phtml index c75e81a1..b906cee3 100644 --- a/src/views/_layouts/connected.phtml +++ b/src/views/_layouts/connected.phtml @@ -284,7 +284,7 @@ diff --git a/src/views/_layouts/turbo_frame.phtml b/src/views/_layouts/modal.phtml similarity index 55% rename from src/views/_layouts/turbo_frame.phtml rename to src/views/_layouts/modal.phtml index 54a0c4ff..886cc14a 100644 --- a/src/views/_layouts/turbo_frame.phtml +++ b/src/views/_layouts/modal.phtml @@ -1,3 +1,3 @@ - + safe('content') ?> diff --git a/src/views/_layouts/not_connected.phtml b/src/views/_layouts/not_connected.phtml index a9899441..8fdf179a 100644 --- a/src/views/_layouts/not_connected.phtml +++ b/src/views/_layouts/not_connected.phtml @@ -194,7 +194,7 @@ diff --git a/src/views/collections/edit.phtml b/src/views/collections/edit.phtml index 00baa48f..7c3763a2 100644 --- a/src/views/collections/edit.phtml +++ b/src/views/collections/edit.phtml @@ -4,6 +4,7 @@ 'current_tab' => 'collections', 'canonical' => url('edit collection', ['id' => $collection->id]), 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> diff --git a/src/views/collections/filters/edit.phtml b/src/views/collections/filters/edit.phtml index 9fbfed13..a59d4e15 100644 --- a/src/views/collections/filters/edit.phtml +++ b/src/views/collections/filters/edit.phtml @@ -3,6 +3,7 @@ 'title' => _('Settings for the news'), 'canonical' => url_full('edit collection filter', ['id' => $collection->id]), 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> diff --git a/src/views/collections/groups/edit.phtml b/src/views/collections/groups/edit.phtml index 2fea203c..a2eddeeb 100644 --- a/src/views/collections/groups/edit.phtml +++ b/src/views/collections/groups/edit.phtml @@ -3,6 +3,7 @@ 'title' => _('Collection group'), 'canonical' => url_full('edit group collection', ['id' => $collection->id]), 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> diff --git a/src/views/collections/images/edit.phtml b/src/views/collections/images/edit.phtml index 2c0b5f1a..6c455946 100644 --- a/src/views/collections/images/edit.phtml +++ b/src/views/collections/images/edit.phtml @@ -3,6 +3,7 @@ 'title' => _('Collection illustration'), 'canonical' => url_full('edit image collection', ['id' => $collection->id]), 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> diff --git a/src/views/collections/links/new.phtml b/src/views/collections/links/new.phtml index abdd6bb3..57b60eef 100644 --- a/src/views/collections/links/new.phtml +++ b/src/views/collections/links/new.phtml @@ -3,6 +3,7 @@ 'title' => _('New link'), 'canonical' => url_full('new collection link', ['id' => $collection->id]), 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> diff --git a/src/views/collections/new.phtml b/src/views/collections/new.phtml index d3c67bf3..0f8268d7 100644 --- a/src/views/collections/new.phtml +++ b/src/views/collections/new.phtml @@ -4,6 +4,7 @@ 'canonical' => url_full('new collection'), 'current_tab' => 'collections', 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> diff --git a/src/views/collections/shares/_index.phtml b/src/views/collections/shares/_index.phtml deleted file mode 100644 index 874fddb3..00000000 --- a/src/views/collections/shares/_index.phtml +++ /dev/null @@ -1,166 +0,0 @@ - -
-
-

name)) ?>

-
- -

- is_public): ?> - - - - -

- -
- include('alerts/_error.phtml', ['message' => $error]) ?> - - - - -
- - -
- - - -
- -
- -

- - -

- - -

- URL of a user’s profile.') ?> -

-
-
- -
- - aria-describedby="type-desc" - data-action="caption-switcher#switch" - data-caption-switcher-target="switch" - /> - - - - - aria-describedby="type-desc" - data-action="caption-switcher#switch" - data-caption-switcher-target="switch" - /> - - - -
- -

- - -

- - -

- - including their hidden links, but they can’t modify it.') ?> - - - - including their hidden links, and they can modify information, add links or comment them.') ?> - -

-
-
-
- - shares(); ?> - -

- -
    - - user(); ?> -
  • - - - - - - - username) ?> - - - - - type === 'read'): ?> - - - - - - -
    - - - - -
    -
  • - -
- - - -
-
diff --git a/src/views/collections/shares/index.phtml b/src/views/collections/shares/index.phtml index 08705a80..7d5693bc 100644 --- a/src/views/collections/shares/index.phtml +++ b/src/views/collections/shares/index.phtml @@ -3,14 +3,171 @@ 'title' => _('Share collection'), 'canonical' => url_full('share collection', ['id' => $collection->id]), 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> -include('collections/shares/_index.phtml', [ - 'collection' => $collection, - 'type' => $this->safe('type'), - 'user_id' => $this->safe('user_id'), - 'from' => $this->safe('from'), - 'errors' => $errors, - 'error' => $this->safe('error'), -]); ?> +
+
+

name)) ?>

+
+ +

+ is_public): ?> + + + + +

+ +
+ include('alerts/_error.phtml', ['message' => $error]) ?> + + + + +
+ + +
+ + + +
+ +
+ +

+ + +

+ + +

+ URL of a user’s profile.') ?> +

+
+
+ +
+ + aria-describedby="type-desc" + data-action="caption-switcher#switch" + data-caption-switcher-target="switch" + /> + + + + + aria-describedby="type-desc" + data-action="caption-switcher#switch" + data-caption-switcher-target="switch" + /> + + + +
+ +

+ + +

+ + +

+ + including their hidden links, but they can’t modify it.') ?> + + + + including their hidden links, and they can modify information, add links or comment them.') ?> + +

+
+
+
+ + shares(); ?> + +

+ + + + + +
diff --git a/src/views/collections/shares/index.turbo_stream.phtml b/src/views/collections/shares/index.turbo_stream.phtml deleted file mode 100644 index dd4066fe..00000000 --- a/src/views/collections/shares/index.turbo_stream.phtml +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/src/views/feeds/_new.phtml b/src/views/feeds/_new.phtml deleted file mode 100644 index 55365466..00000000 --- a/src/views/feeds/_new.phtml +++ /dev/null @@ -1,51 +0,0 @@ - -
-
-

-
- -
- include('alerts/_error.phtml', ['message' => $error]) ?> - - - - -
- - - - -
- -

- - -

- - -

- URL bar, at the top of your browser.') ?> -

-
-
- -
- -
-
-
-
diff --git a/src/views/feeds/new.phtml b/src/views/feeds/new.phtml index 4acf950e..d9ee07e3 100644 --- a/src/views/feeds/new.phtml +++ b/src/views/feeds/new.phtml @@ -4,12 +4,56 @@ 'canonical' => url_full('new feed'), 'current_page' => 'new feed', 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> -include('feeds/_new.phtml', [ - 'url' => $this->safe('url'), - 'from' => $this->safe('from'), - 'errors' => $errors, - 'error' => $this->safe('error'), -]); ?> +
+
+

+
+ +
+ include('alerts/_error.phtml', ['message' => $error]) ?> + + + + +
+ + + + +
+ +

+ + +

+ + +

+ URL bar, at the top of your browser.') ?> +

+
+
+ +
+ +
+
+
diff --git a/src/views/feeds/new.turbo_stream.phtml b/src/views/feeds/new.turbo_stream.phtml deleted file mode 100644 index c051a391..00000000 --- a/src/views/feeds/new.turbo_stream.phtml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/src/views/groups/edit.phtml b/src/views/groups/edit.phtml index 952ecf16..50accd91 100644 --- a/src/views/groups/edit.phtml +++ b/src/views/groups/edit.phtml @@ -3,6 +3,7 @@ 'title' => _('Group edition'), 'canonical' => url_full('edit group', ['id' => $group->id]), 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> diff --git a/src/views/links/collections/index.phtml b/src/views/links/collections/index.phtml index 5c5671ca..df4daca2 100644 --- a/src/views/links/collections/index.phtml +++ b/src/views/links/collections/index.phtml @@ -3,6 +3,7 @@ 'title' => _('Storing a link'), 'canonical' => url_full('link collections', ['id' => $link->id]), 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> diff --git a/src/views/links/edit.phtml b/src/views/links/edit.phtml index dfc5d905..093a4337 100644 --- a/src/views/links/edit.phtml +++ b/src/views/links/edit.phtml @@ -3,6 +3,7 @@ 'title' => _('Link edition'), 'canonical' => url_full('edit link', ['id' => $link->id]), 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> diff --git a/src/views/links/new.phtml b/src/views/links/new.phtml index bb11eaae..d6892466 100644 --- a/src/views/links/new.phtml +++ b/src/views/links/new.phtml @@ -4,6 +4,7 @@ 'canonical' => url_full('new link'), 'current_page' => 'new link', 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> diff --git a/src/views/links/repairing/_new.phtml b/src/views/links/repairing/_new.phtml deleted file mode 100644 index ab5d5028..00000000 --- a/src/views/links/repairing/_new.phtml +++ /dev/null @@ -1,101 +0,0 @@ - -
-
-

-
- -

- URL of a link if it’s broken, or if you made a mistake in it.') ?> -

- -
- include('alerts/_error.phtml', ['message' => $error]) ?> - - - - -
- - - - -
- -

- - -

- - - -

- - URL. Suggestion:', $brand) ?> - - - - - URL tracks users. It is suggested to delete the link.', $brand) ?> - -

- -
-
- -
- - aria-describedby="force-sync-caption" - data-action="caption-switcher#switch" - data-caption-switcher-target="switch" - /> - - - -

- - - - - - - -

-
- -
- -
-
-
-
diff --git a/src/views/links/repairing/new.phtml b/src/views/links/repairing/new.phtml index eee4e575..b71d42d8 100644 --- a/src/views/links/repairing/new.phtml +++ b/src/views/links/repairing/new.phtml @@ -3,15 +3,106 @@ 'title' => _('Repairing a link'), 'canonical' => url_full('repairing link', ['id' => $link->id]), 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> -include('links/repairing/_new.phtml', [ - 'link' => $link, - 'url' => $this->safe('url'), - 'url_cleared' => $this->safe('url_cleared'), - 'force_sync' => $force_sync, - 'from' => $this->safe('from'), - 'errors' => $errors, - 'error' => $this->safe('error'), -]); ?> +
+
+

+
+ +

+ URL of a link if it’s broken, or if you made a mistake in it.') ?> +

+ +
+ include('alerts/_error.phtml', ['message' => $error]) ?> + + + + +
+ + + + +
+ +

+ + +

+ + + +

+ + URL. Suggestion:', $brand) ?> + + + + + URL tracks users. It is suggested to delete the link.', $brand) ?> + +

+ +
+
+ +
+ + aria-describedby="force-sync-caption" + data-action="caption-switcher#switch" + data-caption-switcher-target="switch" + /> + + + +

+ + + + + + + +

+
+ +
+ +
+
+
diff --git a/src/views/links/repairing/new.turbo_stream.phtml b/src/views/links/repairing/new.turbo_stream.phtml deleted file mode 100644 index bd39db0d..00000000 --- a/src/views/links/repairing/new.turbo_stream.phtml +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/src/views/links/searches/show.phtml b/src/views/links/searches/show.phtml index ebf7ee41..dded0b71 100644 --- a/src/views/links/searches/show.phtml +++ b/src/views/links/searches/show.phtml @@ -13,6 +13,7 @@ 'reset' => true, ], 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> diff --git a/src/views/messages/edit.phtml b/src/views/messages/edit.phtml index 961a13c2..5b4a2625 100644 --- a/src/views/messages/edit.phtml +++ b/src/views/messages/edit.phtml @@ -3,6 +3,7 @@ 'title' => _('Message edition'), 'canonical' => url_full('edit message', ['id' => $message->id]), 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> diff --git a/src/views/sessions/new.phtml b/src/views/sessions/new.phtml index fbad72e8..17669074 100644 --- a/src/views/sessions/new.phtml +++ b/src/views/sessions/new.phtml @@ -8,6 +8,7 @@ 'track' => false, ], 'has_errors' => $error || $errors, + 'modal_enabled' => true, ]); ?> diff --git a/tests/controllers/collections/SharesTest.php b/tests/controllers/collections/SharesTest.php index 2dc7778d..c8e09af3 100644 --- a/tests/controllers/collections/SharesTest.php +++ b/tests/controllers/collections/SharesTest.php @@ -173,7 +173,7 @@ public function testCreateRendersCorrectly() ]); $this->assertResponseCode($response, 200); - $this->assertResponsePointer($response, 'collections/shares/index.turbo_stream.phtml'); + $this->assertResponsePointer($response, 'collections/shares/index.phtml'); } public function testCreateCreatesCollectionShare() @@ -325,7 +325,7 @@ public function testCreateFailsIfCsrfIsInvalid() ]); $this->assertResponseCode($response, 400); - $this->assertResponsePointer($response, 'collections/shares/index.turbo_stream.phtml'); + $this->assertResponsePointer($response, 'collections/shares/index.phtml'); $this->assertResponseContains($response, 'A security verification failed'); $collection_share = models\CollectionShare::findBy([ 'collection_id' => $collection_id, @@ -351,7 +351,7 @@ public function testCreateFailsIfUserIdIsTheCurrentUserId() ]); $this->assertResponseCode($response, 400); - $this->assertResponsePointer($response, 'collections/shares/index.turbo_stream.phtml'); + $this->assertResponsePointer($response, 'collections/shares/index.phtml'); $this->assertResponseContains($response, 'You can’t share access with yourself'); $collection_share = models\CollectionShare::findBy([ 'collection_id' => $collection_id, @@ -377,7 +377,7 @@ public function testCreateFailsIfUserIdDoesNotExist() ]); $this->assertResponseCode($response, 400); - $this->assertResponsePointer($response, 'collections/shares/index.turbo_stream.phtml'); + $this->assertResponsePointer($response, 'collections/shares/index.phtml'); $this->assertResponseContains($response, 'This user doesn’t exist'); $collection_share = models\CollectionShare::findBy([ 'collection_id' => $collection_id, @@ -404,7 +404,7 @@ public function testCreateFailsIfUserIdIsSupportUserId() ]); $this->assertResponseCode($response, 400); - $this->assertResponsePointer($response, 'collections/shares/index.turbo_stream.phtml'); + $this->assertResponsePointer($response, 'collections/shares/index.phtml'); $this->assertResponseContains($response, 'This user doesn’t exist'); $collection_share = models\CollectionShare::findBy([ 'collection_id' => $collection_id, @@ -435,7 +435,7 @@ public function testCreateFailsIfCollectionIsAlreadySharedWithUserId() ]); $this->assertResponseCode($response, 400); - $this->assertResponsePointer($response, 'collections/shares/index.turbo_stream.phtml'); + $this->assertResponsePointer($response, 'collections/shares/index.phtml'); $this->assertResponseContains($response, 'The collection is already shared with this user'); $collection_shares = models\CollectionShare::listBy([ 'collection_id' => $collection_id, @@ -463,7 +463,7 @@ public function testCreateFailsIfTypeIsInvalid() ]); $this->assertResponseCode($response, 400); - $this->assertResponsePointer($response, 'collections/shares/index.turbo_stream.phtml'); + $this->assertResponsePointer($response, 'collections/shares/index.phtml'); $this->assertResponseContains($response, 'The type is invalid'); $collection_share = models\CollectionShare::findBy([ 'collection_id' => $collection_id, @@ -490,7 +490,7 @@ public function testCreateFailsIfTypeIsEmpty() ]); $this->assertResponseCode($response, 400); - $this->assertResponsePointer($response, 'collections/shares/index.turbo_stream.phtml'); + $this->assertResponsePointer($response, 'collections/shares/index.phtml'); $this->assertResponseContains($response, 'The type is required'); $collection_share = models\CollectionShare::findBy([ 'collection_id' => $collection_id, @@ -629,7 +629,7 @@ public function testDeleteRendersCorrectly() ]); $this->assertResponseCode($response, 200); - $this->assertResponsePointer($response, 'collections/shares/index.turbo_stream.phtml'); + $this->assertResponsePointer($response, 'collections/shares/index.phtml'); } public function testDeleteRedirectsToLoginIfNotConnected() @@ -756,7 +756,7 @@ public function testDeleteFailsIfCsrfIsInvalid() ]); $this->assertResponseCode($response, 400, $from); - $this->assertResponsePointer($response, 'collections/shares/index.turbo_stream.phtml'); + $this->assertResponsePointer($response, 'collections/shares/index.phtml'); $this->assertResponseContains($response, 'A security verification failed'); $this->assertTrue(models\CollectionShare::exists($collection_share_id)); } diff --git a/tests/controllers/links/RepairingTest.php b/tests/controllers/links/RepairingTest.php index 35d242ef..101ca88c 100644 --- a/tests/controllers/links/RepairingTest.php +++ b/tests/controllers/links/RepairingTest.php @@ -274,7 +274,7 @@ public function testCreateFailsIfTheCsrfIsInvalid() ]); $this->assertResponseCode($response, 400); - $this->assertResponsePointer($response, 'links/repairing/new.turbo_stream.phtml'); + $this->assertResponsePointer($response, 'links/repairing/new.phtml'); $this->assertResponseContains($response, 'A security verification failed'); $link = models\Link::find($link_id); $this->assertSame($old_url, $link->url); @@ -298,7 +298,7 @@ public function testCreateFailsIfTheUrlIsInvalid() ]); $this->assertResponseCode($response, 400); - $this->assertResponsePointer($response, 'links/repairing/new.turbo_stream.phtml'); + $this->assertResponsePointer($response, 'links/repairing/new.phtml'); $this->assertResponseContains($response, 'Link scheme must be either http or https.'); $link = models\Link::find($link_id); $this->assertSame($old_url, $link->url);