Commit 57ad0aa5 authored by Justin Ho's avatar Justin Ho

Fix Slack slash commands using relative URL

- Fix is for both Slack and Mattermost
- avatar_url actually calls avatar_path from within
Avatarable concern. It does allow to pass an
argument to include the full URL with only_path: false
- Update one of the specs to check this behaviour
parent 2b455019
---
title: Fix Slack slash commands using relative URL
merge_request: 29160
author:
type: fixed
......@@ -91,7 +91,7 @@ module Gitlab
title: "#{issue.title} · #{issue.to_reference}",
title_link: resource_url,
author_name: author.name,
author_icon: author.avatar_url,
author_icon: author.avatar_url(only_path: false),
fallback: fallback_message,
pretext: custom_pretext,
text: text,
......
......@@ -3,7 +3,8 @@
require 'spec_helper'
describe Gitlab::SlashCommands::Presenters::IssueShow do
let(:project) { create(:project) }
let(:user) { create(:user, :with_avatar) }
let(:project) { create(:project, creator: user) }
let(:issue) { create(:issue, project: project) }
let(:attachment) { subject[:attachments].first }
......@@ -15,6 +16,7 @@ describe Gitlab::SlashCommands::Presenters::IssueShow do
expect(subject[:response_type]).to be(:in_channel)
expect(subject).to have_key(:attachments)
expect(attachment[:title]).to start_with(issue.title)
expect(attachment[:author_icon]).to eq(user.avatar_url(only_path: false))
end
context 'with upvotes' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment