summaryrefslogtreecommitdiff
path: root/spec/models/wiki_page_spec.rb
diff options
context:
space:
mode:
authorSatish Perala <satish@cybrilla.com>2016-08-25 22:35:59 +0530
committerSean McGivern <sean@gitlab.com>2018-06-20 14:13:23 +0100
commit9170aab92e616a6f6d3ddfc4cf8326cba0e4a1a8 (patch)
treead2c13c7521fedb74f89693dd4561e92f92167db /spec/models/wiki_page_spec.rb
parentb349c01c6a71ac1f486b8ee86ce96ef48ac04ed8 (diff)
downloadgitlab-ce-9170aab92e616a6f6d3ddfc4cf8326cba0e4a1a8.tar.gz
Passing absolute image urls in the markdown content in the webhooks
Diffstat (limited to 'spec/models/wiki_page_spec.rb')
-rw-r--r--spec/models/wiki_page_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb
index 1c765ceac2f..c00c628b172 100644
--- a/spec/models/wiki_page_spec.rb
+++ b/spec/models/wiki_page_spec.rb
@@ -554,6 +554,18 @@ describe WikiPage do
end
end
+ describe '#hook_attrs' do
+ before do
+ create_page("test page", "test![WikiPage_Image](/uploads/abc/WikiPage_Image.png)")
+ @page = wiki.wiki.paged("test page")
+ @wiki_page = WikiPage.new(wiki, @page, true)
+ end
+
+ it 'adds absolute urls for images in the content' do
+ expect(@wiki_page.hook_attrs['content']).to eq("test![WikiPage_Image](#{Settings.gitlab.url}/uploads/abc/WikiPage_Image.png)")
+ end
+ end
+
private
def remove_temp_repo(path)