diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-05-27 12:47:49 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-05-27 12:47:49 +0000 |
commit | ae1d81661d6b0d609cea0d5e3d0e8af547e33ead (patch) | |
tree | 52e0ff5eaff8605ecb5b46765a8b78a223a334c0 /spec | |
parent | 545e48310c66f1bc8cec91ca83ca827a51e35ced (diff) | |
parent | 96d8f009bc762b94e66fa96e5a38f3e3ee2faeb0 (diff) | |
download | gitlab-ce-ae1d81661d6b0d609cea0d5e3d0e8af547e33ead.tar.gz |
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
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/issuable/clone/content_rewriter_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/services/issuable/clone/content_rewriter_spec.rb b/spec/services/issuable/clone/content_rewriter_spec.rb index 4d3cb0bd254..230e1123280 100644 --- a/spec/services/issuable/clone/content_rewriter_spec.rb +++ b/spec/services/issuable/clone/content_rewriter_spec.rb @@ -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 |