FIX: Keep emoji images in group bio excerpt (#8329)
This commit is contained in:
parent
544a1379b6
commit
6672dcc985
|
@ -45,7 +45,7 @@ class BasicGroupSerializer < ApplicationSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def bio_excerpt
|
def bio_excerpt
|
||||||
PrettyText.excerpt(object.bio_cooked, 110) if object.bio_cooked.present?
|
PrettyText.excerpt(object.bio_cooked, 110, keep_emoji_images: true) if object.bio_cooked.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def include_incoming_email?
|
def include_incoming_email?
|
||||||
|
|
|
@ -26,7 +26,7 @@ describe BasicGroupSerializer do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#bio_raw' do
|
describe '#bio_raw' do
|
||||||
fab!(:group) { Fabricate(:group, bio_raw: 'testing') }
|
fab!(:group) { Fabricate(:group, bio_raw: 'testing :slightly_smiling_face:') }
|
||||||
|
|
||||||
subject do
|
subject do
|
||||||
described_class.new(group, scope: guardian, root: false, owner_group_ids: [group.id])
|
described_class.new(group, scope: guardian, root: false, owner_group_ids: [group.id])
|
||||||
|
@ -34,7 +34,8 @@ describe BasicGroupSerializer do
|
||||||
|
|
||||||
describe 'group owner' do
|
describe 'group owner' do
|
||||||
it 'should include bio_raw' do
|
it 'should include bio_raw' do
|
||||||
expect(subject.as_json[:bio_raw]).to eq('testing')
|
expect(subject.as_json[:bio_raw]).to eq('testing :slightly_smiling_face:')
|
||||||
|
expect(subject.as_json[:bio_excerpt]).to start_with('testing <img')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue