mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: extract links in post processor
when oneboxes are not cached or are refreshed they can introduce new links, these links must be extracted otherwise you can not follow them
This commit is contained in:
parent
cb6d1632ba
commit
22b2f5285c
4 changed files with 24 additions and 3 deletions
|
@ -387,8 +387,12 @@ describe PostsController do
|
|||
end
|
||||
|
||||
it "extracts links from the new body" do
|
||||
TopicLink.expects(:extract_from).with(post)
|
||||
xhr :put, :update, update_params
|
||||
param = update_params
|
||||
param[:post][:raw] = 'I just visited this https://google.com so many cool links'
|
||||
|
||||
xhr :put, :update, param
|
||||
expect(response).to be_success
|
||||
expect(TopicLink.count).to eq(1)
|
||||
end
|
||||
|
||||
it "doesn't allow updating of deleted posts" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue