Commit ec7821d8 authored by egrieff's avatar egrieff

Test that upload links are rewritten for new notes

parent ae1bc2fd
......@@ -149,5 +149,21 @@ describe Issuable::Clone::ContentRewriter do
expect(new_note.author).to eq(note.author)
end
end
context 'notes with uploads' 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 correclty' 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