mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Don't count draft views towards topic view stats (#28162)
When creating a shared draft, we're recording topic view stats on the draft and then pass those on when the draft is published, conflating the actual view count. This fixes that by not registering topic views if the topic is a shared draft.
This commit is contained in:
@@ -161,6 +161,20 @@ RSpec.describe Topic do
|
||||
|
||||
it { is_expected.to rate_limit }
|
||||
|
||||
describe "#shared_draft?" do
|
||||
fab!(:topic)
|
||||
|
||||
context "when topic does not have a shared draft record" do
|
||||
it { expect(topic).not_to be_shared_draft }
|
||||
end
|
||||
|
||||
context "when topic has a shared draft record" do
|
||||
before { Fabricate(:shared_draft, topic: topic) }
|
||||
|
||||
it { expect(topic).to be_shared_draft }
|
||||
end
|
||||
end
|
||||
|
||||
describe "#visible_post_types" do
|
||||
let(:types) { Post.types }
|
||||
|
||||
|
Reference in New Issue
Block a user