FIX: Group inbox new filter not accounting for dismissed topics.

Follow-up to 2c046cc670161e3b9f998edcc7500d18bcfd8f9a
This commit is contained in:
Alan Guo Xiang Tan
2021-08-05 16:36:52 +08:00
parent 3f59ccefd7
commit 0bf27242ec
2 changed files with 11 additions and 0 deletions

View File

@ -203,6 +203,16 @@ describe TopicQuery::PrivateMessageLists do
expect(topics).to contain_exactly(group_message)
end
it 'returns a list of new private messages for a group accounting for dismissed topics' do
Fabricate(:dismissed_topic_user, topic: group_message, user: user_2)
topics = TopicQuery.new(nil, group_name: group.name)
.list_private_messages_group_new(user_2)
.topics
expect(topics).to eq([])
end
end
describe '#list_private_messages_group_unread' do