diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-31 15:08:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-31 15:08:33 +0300 |
commit | 1808454313ed75c92e1384466e8c83bfbc8ae25e (patch) | |
tree | 5c006c158fd796dc6d21e9bd771542f2fb0c24e2 /spec/features/markdown | |
parent | fd3a95f07ae9cd78fecffcfa5de4494f933a7808 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/markdown')
-rw-r--r-- | spec/features/markdown/copy_as_gfm_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/features/markdown/copy_as_gfm_spec.rb b/spec/features/markdown/copy_as_gfm_spec.rb index ef3a36f3128..f85acc28645 100644 --- a/spec/features/markdown/copy_as_gfm_spec.rb +++ b/spec/features/markdown/copy_as_gfm_spec.rb @@ -172,18 +172,36 @@ describe 'Copy as GFM', :js do '![Image](https://example.com/image.png)' ) + verify_media_with_partial_path( + '![Image](/uploads/a123/image.png)', + + project_media_uri(@project, '/uploads/a123/image.png') + ) + verify( 'VideoLinkFilter', '![Video](https://example.com/video.mp4)' ) + verify_media_with_partial_path( + '![Video](/uploads/a123/video.mp4)', + + project_media_uri(@project, '/uploads/a123/video.mp4') + ) + verify( 'AudioLinkFilter', '![Audio](https://example.com/audio.wav)' ) + verify_media_with_partial_path( + '![Audio](/uploads/a123/audio.wav)', + + project_media_uri(@project, '/uploads/a123/audio.wav') + ) + verify( 'MathFilter: math as converted from GFM to HTML', @@ -647,6 +665,16 @@ describe 'Copy as GFM', :js do end end + def project_media_uri(project, media_path) + "#{project_path(project)}#{media_path}" + end + + def verify_media_with_partial_path(gfm, media_uri) + html = gfm_to_html(gfm) + output_gfm = html_to_gfm(html) + expect(output_gfm).to include(media_uri) + end + # Fake a `current_user` helper def current_user @feat.user |