mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: display correct replies count in embedded comments view. (#14175)
Previosuly, the reply count included the "small_action" posts too. It also caused the broken embed HTML issue.
This commit is contained in:
@@ -166,3 +166,7 @@ end
|
||||
Fabricator(:whisper, from: :post) do
|
||||
post_type Post.types[:whisper]
|
||||
end
|
||||
|
||||
Fabricator(:small_action, from: :post) do
|
||||
post_type Post.types[:small_action]
|
||||
end
|
||||
|
||||
@@ -229,6 +229,14 @@ describe EmbedController do
|
||||
|
||||
expect(response.body).to match(I18n.t('embed.continue'))
|
||||
expect(response.body).to match(post.cooked)
|
||||
expect(response.body).to match("<span class='replies'>1 reply</span>")
|
||||
|
||||
small_action = Fabricate(:small_action, topic: topic_embed.topic)
|
||||
|
||||
get '/embed/comments', params: { embed_url: embed_url }, headers: headers
|
||||
|
||||
expect(response.body).not_to match("post-#{small_action.id}")
|
||||
expect(response.body).to match("<span class='replies'>1 reply</span>")
|
||||
end
|
||||
|
||||
it "provides the topic retriever with the discourse username when provided" do
|
||||
|
||||
Reference in New Issue
Block a user