From 36a4194ee3013dfa834aa8d4d57b0bfacf724a1a Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 30 Jul 2026 04:41:07 +0200 Subject: Emit per-page Open Graph metadata Replaces one hardcoded German description and an unrenderable SVG with per-page title, description, canonical URL, locale and publication date, plus the card variant or a site-wide default. --- test/controllers/shared_previews_controller_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/controllers/shared_previews_controller_test.rb') diff --git a/test/controllers/shared_previews_controller_test.rb b/test/controllers/shared_previews_controller_test.rb index 4ebc785f..6d4588a8 100644 --- a/test/controllers/shared_previews_controller_test.rb +++ b/test/controllers/shared_previews_controller_test.rb @@ -32,4 +32,19 @@ class SharedPreviewsControllerTest < ActionController::TestCase assert_redirected_to node.head.public_link end + + test "a shared preview emits no social metadata and is not indexable" do + node = Node.root.children.create!(:slug => "shared_preview_no_og_test") + node.draft.update!(:title => "Unveröffentlichter Entwurf") + node.draft.ensure_preview_token! + + get :show, params: { :token => node.draft.preview_token } + + assert_response :success + + # An unfurled preview link would otherwise hand the draft's title, + # abstract and headline image to everyone in the chat room. + assert_select "meta[property^='og:']", false, "a preview must emit no og tags" + assert_select "meta[name=robots][content=?]", "noindex, nofollow" + end end -- cgit v1.3