Commit 682ba57a authored by Ville Skyttä's avatar Ville Skyttä

Include commit message instead of entire page in Wiki chat notifications

Closes https://gitlab.com/gitlab-org/gitlab/issues/20812
parent 43323f0c
......@@ -14,7 +14,7 @@ module ChatMessage
obj_attr = HashWithIndifferentAccess.new(obj_attr)
@title = obj_attr[:title]
@wiki_page_url = obj_attr[:url]
@description = obj_attr[:content]
@description = obj_attr[:message]
@action =
case obj_attr[:action]
......
---
title: Include commit message instead of entire page content in Wiki chat notifications
merge_request: 21722
author: Ville Skyttä
type: changed
......@@ -17,7 +17,8 @@ describe ChatMessage::WikiPageMessage do
object_attributes: {
title: 'Wiki page title',
url: 'http://url.com',
content: 'Wiki page description'
content: 'Wiki page content',
message: 'Wiki page commit message'
}
}
end
......@@ -57,10 +58,10 @@ describe ChatMessage::WikiPageMessage do
args[:object_attributes][:action] = 'create'
end
it 'returns the attachment for a new wiki page' do
it 'returns the commit message for a new wiki page' do
expect(subject.attachments).to eq([
{
text: "Wiki page description",
text: "Wiki page commit message",
color: color
}
])
......@@ -72,10 +73,10 @@ describe ChatMessage::WikiPageMessage do
args[:object_attributes][:action] = 'update'
end
it 'returns the attachment for an updated wiki page' do
it 'returns the commit message for an updated wiki page' do
expect(subject.attachments).to eq([
{
text: "Wiki page description",
text: "Wiki page commit message",
color: color
}
])
......@@ -119,8 +120,8 @@ describe ChatMessage::WikiPageMessage do
args[:object_attributes][:action] = 'create'
end
it 'returns the attachment for a new wiki page' do
expect(subject.attachments).to eq('Wiki page description')
it 'returns the commit message for a new wiki page' do
expect(subject.attachments).to eq('Wiki page commit message')
end
end
......@@ -129,8 +130,8 @@ describe ChatMessage::WikiPageMessage do
args[:object_attributes][:action] = 'update'
end
it 'returns the attachment for an updated wiki page' do
expect(subject.attachments).to eq('Wiki page description')
it 'returns the commit message for an updated wiki page' do
expect(subject.attachments).to eq('Wiki page commit message')
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