Commit 37495394 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'zj-add-weights-gitlab-response' into 'master'

Add weight to chat messages

See merge request !1172
parents 817d454b ec10de7a
......@@ -34,6 +34,11 @@ module Gitlab
title: "Labels",
value: @resource.labels.any? ? @resource.label_names : "_None_",
short: true
},
{
title: "Weight",
value: @resource.weight? ? @resource.weight : "_None_",
short: true
}
]
end
......
......@@ -34,4 +34,14 @@ describe Gitlab::ChatCommands::Presenters::IssueShow do
expect(attachment[:text]).to start_with("**Open**")
end
end
context 'issue with issue weight' do
let(:issue) { create(:issue, project: project, weight: 3) }
let(:weight_attachment) { subject[:attachments].first[:fields].find { |a| a[:title] == "Weight" } }
it 'shows the weight' do
expect(weight_attachment).not_to be_nil
expect(weight_attachment[:value]).to be(3)
end
end
end
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