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:
authorSatish Perala <satish@cybrilla.com>2016-08-25 20:05:59 +0300
committerSean McGivern <sean@gitlab.com>2018-06-20 16:13:23 +0300
commit9170aab92e616a6f6d3ddfc4cf8326cba0e4a1a8 (patch)
treead2c13c7521fedb74f89693dd4561e92f92167db /spec/lib/gitlab/hook_data
parentb349c01c6a71ac1f486b8ee86ce96ef48ac04ed8 (diff)
Passing absolute image urls in the markdown content in the webhooks
Diffstat (limited to 'spec/lib/gitlab/hook_data')
-rw-r--r--spec/lib/gitlab/hook_data/issue_builder_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/lib/gitlab/hook_data/issue_builder_spec.rb b/spec/lib/gitlab/hook_data/issue_builder_spec.rb
index 506b2c0be20..0e4a1d345f4 100644
--- a/spec/lib/gitlab/hook_data/issue_builder_spec.rb
+++ b/spec/lib/gitlab/hook_data/issue_builder_spec.rb
@@ -40,5 +40,14 @@ describe Gitlab::HookData::IssueBuilder do
expect(data).to include(:human_total_time_spent)
expect(data).to include(:assignee_ids)
end
+
+ context 'when the issue has an image in the description' do
+ let(:issue_with_description) { create(:issue, description: 'test![Issue_Image](/uploads/abc/Issue_Image.png)') }
+ let(:builder) { described_class.new(issue_with_description) }
+
+ it 'adds absolute urls for images in the description' do
+ expect(data[:description]).to eq("test![Issue_Image](#{Settings.gitlab.url}/uploads/abc/Issue_Image.png)")
+ end
+ end
end
end