Revert unread optimisation, has too many edge cases

This commit is contained in:
Sam
2017-05-26 09:04:13 -04:00
parent 4d9481bf47
commit 0aed2533ac
12 changed files with 26 additions and 159 deletions
-28
View File
@@ -10,34 +10,6 @@ describe UserStat do
expect(user.user_stat.new_since).to be_present
end
context "#update_first_topic_unread_at" do
it "updates date correctly for staff" do
now = Time.zone.now
admin = Fabricate(:admin)
topic = Fabricate(:topic,
highest_staff_post_number: 7,
highest_post_number: 1,
last_unread_at: now
)
UserStat.update_first_topic_unread_at!
admin.reload
expect(admin.user_stat.first_topic_unread_at).to_not be_within(5.years).of(now)
TopicUser.change(admin.id, topic.id, last_read_post_number: 1,
notification_level: NotificationLevels.all[:tracking])
UserStat.update_first_topic_unread_at!
admin.reload
expect(admin.user_stat.first_topic_unread_at).to be_within(1.second).of(now)
end
end
context '#update_view_counts' do
let(:user) { Fabricate(:user) }