mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 20:21:25 +08:00
Improvements to user drafts (#6226)
* drafts in user profile: only show to user herself (not to admins), use avatar replying to (instead of topic OP), add keyboard shortcut for drafts, simplify display labels * use JSON when testing Draft.stream
This commit is contained in:
@ -73,19 +73,19 @@ describe Draft do
|
||||
end
|
||||
|
||||
it "should include the correct number of drafts in the stream" do
|
||||
Draft.set(@user, "test", 0, "first")
|
||||
Draft.set(@user, "test2", 0, "second")
|
||||
Draft.set(@user, "test", 0, '{"reply":"hey.","action":"createTopic","title":"Hey"}')
|
||||
Draft.set(@user, "test2", 0, '{"reply":"howdy"}')
|
||||
expect(stream.count).to eq(2)
|
||||
end
|
||||
|
||||
it "should include the right topic id in a draft reply in the stream" do
|
||||
Draft.set(@user, "topic_#{public_topic.id}", 0, "hey")
|
||||
Draft.set(@user, "topic_#{public_topic.id}", 0, '{"reply":"hi"}')
|
||||
draft_row = stream.first
|
||||
expect(draft_row.topic_id).to eq(public_topic.id)
|
||||
end
|
||||
|
||||
it "should include the right draft username in the stream" do
|
||||
Draft.set(@user, "topic_#{public_topic.id}", 0, "hey")
|
||||
Draft.set(@user, "topic_#{public_topic.id}", 0, '{"reply":"hey"}')
|
||||
draft_row = stream.first
|
||||
expect(draft_row.draft_username).to eq(@user.username)
|
||||
end
|
||||
|
Reference in New Issue
Block a user