FEATURE: track statistics around post creation

- how long were people typing?
- how long was composer open?
- how many drafts were created?
- correct, draft saved to go away after you continue typing

store in Post.find(xyz).post_stat
This commit is contained in:
Sam
2015-08-03 14:29:04 +10:00
parent 5d40695908
commit 7b8b96446e
11 changed files with 148 additions and 12 deletions

View File

@ -213,6 +213,21 @@ describe PostCreator do
}.to_not change { topic.excerpt }
end
it 'creates post stats' do
Draft.set(user, 'new_topic', 0, "test")
Draft.set(user, 'new_topic', 0, "test1")
begin
PostCreator.track_post_stats = true
post = creator.create
expect(post.post_stat.typing_duration_msecs).to eq(0)
expect(post.post_stat.drafts_saved).to eq(2)
ensure
PostCreator.track_post_stats = false
end
end
describe "topic's auto close" do
it "doesn't update topic's auto close when it's not based on last post" do