Commit ae1d8166 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch '57825-moving-an-issue-results-in-broken-image-links-in-comments' into 'master'

Resolve "Moving an issue results in broken image links in comments"

Closes #57825

See merge request gitlab-org/gitlab-ce!28654
parents 545e4831 96d8f009
......@@ -28,6 +28,7 @@ module Issuable
new_params = {
project: new_entity.project, noteable: new_entity,
note: rewrite_content(new_note.note),
note_html: nil,
created_at: note.created_at,
updated_at: note.updated_at
}
......
---
title: Resolve moving an issue results in broken image links in comments
merge_request: 28654
author:
type: fixed
......@@ -149,5 +149,21 @@ describe Issuable::Clone::ContentRewriter do
expect(new_note.author).to eq(note.author)
end
end
context 'notes with upload' do
let(:uploader) { build(:file_uploader, project: project1) }
let(:text) { "Simple text with image: #{uploader.markdown_link} "}
let!(:note) { create(:note, noteable: original_issue, note: text, project: project1) }
it 'rewrites note content correctly' do
subject.execute
new_note = new_issue.notes.first
expect(note.note).to match(/Simple text with image: #{FileUploader::MARKDOWN_PATTERN}/)
expect(new_note.note).to match(/Simple text with image: #{FileUploader::MARKDOWN_PATTERN}/)
expect(note.note).not_to eq(new_note.note)
expect(note.note_html).not_to eq(new_note.note_html)
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment