diff options
author | Sean McGivern <sean@gitlab.com> | 2018-04-10 13:55:51 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-06-20 14:13:24 +0100 |
commit | 6e4d67e099cfe15bc5daf5014fd74d9ceb1cb3f3 (patch) | |
tree | d01c18df3c331a64fbe33bf84a6c0c5a032fde20 /spec/lib/gitlab/hook_data | |
parent | 95265c08216e380a3cd2208ff99956fcdccd5a86 (diff) | |
download | gitlab-ce-6e4d67e099cfe15bc5daf5014fd74d9ceb1cb3f3.tar.gz |
Fix hook data specs
Diffstat (limited to 'spec/lib/gitlab/hook_data')
-rw-r--r-- | spec/lib/gitlab/hook_data/issue_builder_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/hook_data/merge_request_builder_spec.rb | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/spec/lib/gitlab/hook_data/issue_builder_spec.rb b/spec/lib/gitlab/hook_data/issue_builder_spec.rb index 0e4a1d345f4..60093474f8a 100644 --- a/spec/lib/gitlab/hook_data/issue_builder_spec.rb +++ b/spec/lib/gitlab/hook_data/issue_builder_spec.rb @@ -45,7 +45,7 @@ describe Gitlab::HookData::IssueBuilder 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 + it 'sets the image to use an absolute URL' do expect(data[:description]).to eq("test![Issue_Image](#{Settings.gitlab.url}/uploads/abc/Issue_Image.png)") end end diff --git a/spec/lib/gitlab/hook_data/merge_request_builder_spec.rb b/spec/lib/gitlab/hook_data/merge_request_builder_spec.rb index b61614e4790..dd586af6118 100644 --- a/spec/lib/gitlab/hook_data/merge_request_builder_spec.rb +++ b/spec/lib/gitlab/hook_data/merge_request_builder_spec.rb @@ -56,5 +56,14 @@ describe Gitlab::HookData::MergeRequestBuilder do expect(data).to include(:human_time_estimate) expect(data).to include(:human_total_time_spent) end + + context 'when the MR has an image in the description' do + let(:mr_with_description) { create(:merge_request, description: 'test![Issue_Image](/uploads/abc/Issue_Image.png)') } + let(:builder) { described_class.new(mr_with_description) } + + it 'sets the image to use an absolute URL' do + expect(data[:description]).to eq("test![Issue_Image](#{Settings.gitlab.url}/uploads/abc/Issue_Image.png)") + end + end end end |