mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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
|
||||
|
||||
@@ -109,6 +109,12 @@ describe Draft do
|
||||
expect(Draft.get(p.user, p.topic.draft_key, s)).to eq nil
|
||||
end
|
||||
|
||||
it 'increases the sequence number when a post is revised'
|
||||
it 'increases revision each time you set' do
|
||||
u = User.first
|
||||
Draft.set(u, 'new_topic', 0, 'hello')
|
||||
Draft.set(u, 'new_topic', 0, 'goodbye')
|
||||
|
||||
expect(Draft.find_draft(u, 'new_topic').revisions).to eq(2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user