Commit 765d509a authored by Douwe Maan's avatar Douwe Maan

Merge branch 'zj-fix-slash-command-labels' into 'master'

Chat slash commands show labels correctly

Closes #28358

See merge request !9408
parents 55842d4d 63bd79f5
---
title: Chat slash commands show labels correctly
merge_request:
author:
......@@ -32,7 +32,7 @@ module Gitlab
},
{
title: "Labels",
value: @resource.labels.any? ? @resource.label_names : "_None_",
value: @resource.labels.any? ? @resource.label_names.join(', ') : "_None_",
short: true
}
]
......
......@@ -26,6 +26,21 @@ describe Gitlab::ChatCommands::Presenters::IssueShow do
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
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