From 80a5482f28eca127b925c3dccda5648b7fe5eda0 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 1 Oct 2020 15:40:13 -0400 Subject: [PATCH] Embedded topics are now unlisted by default Previously this site setting `embed unlisted` defaulted to false and empty topics would be generated for embed, but those topics tend to take up a lot of room on the topic lists. This new default creates invisible topics by default until they receive their first reply. --- config/site_settings.yml | 2 +- spec/models/topic_embed_spec.rb | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config/site_settings.yml b/config/site_settings.yml index cf284b67d2..a690211616 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -939,7 +939,7 @@ posting: embed_any_origin: false embed_topics_list: false embed_set_canonical_url: false - embed_unlisted: false + embed_unlisted: true embed_truncate: true embed_support_markdown: false allowed_embed_selectors: "" diff --git a/spec/models/topic_embed_spec.rb b/spec/models/topic_embed_spec.rb index 48df6ce768..d3dc1567b1 100644 --- a/spec/models/topic_embed_spec.rb +++ b/spec/models/topic_embed_spec.rb @@ -41,7 +41,7 @@ describe TopicEmbed do expect(TopicEmbed.where(topic_id: post.topic_id)).to be_present expect(post.topic.category).to eq(embeddable_host.category) - expect(post.topic).to be_visible + expect(post.topic).not_to be_visible end it "Supports updating the post content" do @@ -88,6 +88,13 @@ describe TopicEmbed do pc.create expect(imported_post.topic.reload).to be_visible end + + it "won't be invisible if `embed_unlisted` is set to false" do + Jobs.run_immediately! + SiteSetting.embed_unlisted = false + imported_post = TopicEmbed.import(user, "http://eviltrout.com/abcd", title, "some random content") + expect(imported_post.topic).to be_visible + end end context "post creation supports markdown rendering" do