Commit dc9549a3 authored by Z.J. van de Weg's avatar Z.J. van de Weg

Chat slash commands show labels correctly

parent db5fdc2d
---
title: Chat slash commands show labels correctly
merge_request:
author:
...@@ -32,7 +32,7 @@ module Gitlab ...@@ -32,7 +32,7 @@ module Gitlab
}, },
{ {
title: "Labels", title: "Labels",
value: @resource.labels.any? ? @resource.label_names : "_None_", value: @resource.labels.any? ? @resource.label_names.join(', ') : "_None_",
short: true short: true
}, },
{ {
......
...@@ -26,6 +26,21 @@ describe Gitlab::ChatCommands::Presenters::IssueShow do ...@@ -26,6 +26,21 @@ describe Gitlab::ChatCommands::Presenters::IssueShow do
end end
end end
context 'with labels' do
let(:label) { create(:label, project: project, title: 'mep') }
let(:label1) { create(:label, project: project, title: 'mop') }
before do
issue.labels << [label, label1]
end
it 'shows the labels' do
labels = attachment[:fields].find { |f| f[:title] == 'Labels' }
expect(labels[:value]).to eq("mep, mop")
end
end
context 'confidential issue' do context 'confidential issue' do
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
......
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