Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/markup_helper_spec.rb')
-rw-r--r--spec/helpers/markup_helper_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/helpers/markup_helper_spec.rb b/spec/helpers/markup_helper_spec.rb
index 45e8a2e7e1a..3d1690f6588 100644
--- a/spec/helpers/markup_helper_spec.rb
+++ b/spec/helpers/markup_helper_spec.rb
@@ -355,6 +355,21 @@ RSpec.describe MarkupHelper do
expect(doc.css('.gl-label-link')).not_to be_empty
end
end
+
+ context 'when content has uploads' do
+ let(:upload_link) { '/uploads/test.png' }
+ let(:content) { "![ImageTest](#{upload_link})" }
+
+ before do
+ allow(wiki).to receive(:wiki_base_path).and_return(project.wiki.wiki_base_path)
+ end
+
+ it 'renders uploads relative to project' do
+ result = helper.render_wiki_content(wiki)
+
+ expect(result).to include("#{project.full_path}#{upload_link}")
+ end
+ end
end
context 'when file is Asciidoc' do