FEATURE: Cook drafts excerpt in user activity (#14315)

The previous excerpt was a simple truncated raw message. Starting with
this commit, the raw content of the draft is cooked and an excerpt is
extracted from it. The logic for extracting the excerpt mimics the the
`ExcerptParser` class, but does not implement all functionality, being
a much simpler implementation.

The two draft controllers have been merged into one and the /draft.json
route has been changed to /drafts.json to be consistent with the other
route names.
This commit is contained in:
Dan Ungureanu
2021-09-14 15:18:01 +03:00
committed by GitHub
parent dde66b9e16
commit f517b6997c
18 changed files with 438 additions and 437 deletions

View File

@@ -478,7 +478,7 @@ RSpec.describe SessionController do
UserAuthToken.destroy_all
# we need a route that will call current user
post '/draft.json', params: {}
post '/drafts.json', params: {}
expect(response.headers['Discourse-Logged-Out']).to eq("1")
end
end