Commit b1f924c1 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'handle-nil-description-slack-message' into 'master'

Handle nil descriptions in Slack issue messages

Closes #14676

See merge request !3420
parents c19195f4 2fa20f2d
......@@ -7,6 +7,7 @@ v 8.7.0 (unreleased)
- Allow back dating on issues when created through the API
- Fix avatar stretching by providing a cropping feature
- Add links to CI setup documentation from project settings and builds pages
- Handle nil descriptions in Slack issue messages (Stan Hu)
- Implement 'Groups View' as an option for dashboard preferences !3379 (Elias W.)
- Implement 'TODOs View' as an option for dashboard preferences !3379 (Elias W.)
......
......@@ -22,7 +22,7 @@ class SlackService
@issue_url = obj_attr[:url]
@action = obj_attr[:action]
@state = obj_attr[:state]
@description = obj_attr[:description]
@description = obj_attr[:description] || ''
end
def attachments
......
......@@ -27,6 +27,16 @@ describe SlackService::IssueMessage, models: true do
let(:color) { '#345' }
context '#initialize' do
before do
args[:object_attributes][:description] = nil
end
it 'returns a non-null description' do
expect(subject.description).to eq('')
end
end
context 'open' do
it 'returns a message regarding opening of issues' do
expect(subject.pretext).to eq(
......
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