Commit 31bda200 authored by Ash McKenzie's avatar Ash McKenzie

Merge branch 'jh-chat-slash-commands-user-avatar-relative-url' into 'master'

Fix Slack slash commands using relative URL

See merge request gitlab-org/gitlab!29160
parents 3298aaee 57ad0aa5
---
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