mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user