summaryrefslogtreecommitdiff
path: root/test/controllers/shared_previews_controller_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/controllers/shared_previews_controller_test.rb')
-rw-r--r--test/controllers/shared_previews_controller_test.rb15
1 files changed, 15 insertions, 0 deletions
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
32 32
33 assert_redirected_to node.head.public_link 33 assert_redirected_to node.head.public_link
34 end 34 end
35
36 test "a shared preview emits no social metadata and is not indexable" do
37 node = Node.root.children.create!(:slug => "shared_preview_no_og_test")
38 node.draft.update!(:title => "Unveröffentlichter Entwurf")
39 node.draft.ensure_preview_token!
40
41 get :show, params: { :token => node.draft.preview_token }
42
43 assert_response :success
44
45 # An unfurled preview link would otherwise hand the draft's title,
46 # abstract and headline image to everyone in the chat room.
47 assert_select "meta[property^='og:']", false, "a preview must emit no og tags"
48 assert_select "meta[name=robots][content=?]", "noindex, nofollow"
49 end
35end 50end