mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FEATURE: New way to dismiss new topics (#11927)
This is a try to simplify logic around dismiss new topics to have one solution to work in all places - dismiss all-new, dismiss new in a specific category or even in a specific tag.
This commit is contained in:

committed by
GitHub

parent
151193bb11
commit
f39e7fe81d
@ -563,7 +563,7 @@ describe TopicTrackingState do
|
||||
end
|
||||
end
|
||||
|
||||
it "correctly handles seen categories" do
|
||||
it "correctly handles dismissed topics" do
|
||||
freeze_time 1.minute.ago
|
||||
user = Fabricate(:user)
|
||||
post
|
||||
@ -571,6 +571,7 @@ describe TopicTrackingState do
|
||||
report = TopicTrackingState.report(user)
|
||||
expect(report.length).to eq(1)
|
||||
|
||||
DismissedTopicUser.create!(user_id: user.id, topic_id: post.topic_id, created_at: Time.zone.now)
|
||||
CategoryUser.create!(user_id: user.id,
|
||||
notification_level: CategoryUser.notification_levels[:regular],
|
||||
category_id: post.topic.category_id,
|
||||
@ -579,12 +580,6 @@ describe TopicTrackingState do
|
||||
|
||||
report = TopicTrackingState.report(user)
|
||||
expect(report.length).to eq(0)
|
||||
|
||||
unfreeze_time
|
||||
post.topic.touch(:created_at)
|
||||
|
||||
report = TopicTrackingState.report(user)
|
||||
expect(report.length).to eq(1)
|
||||
end
|
||||
|
||||
it "correctly handles capping" do
|
||||
|
Reference in New Issue
Block a user