mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-27 06:03:42 +01:00
f49339ca9c
* Fix multipoint shortcode bug * Added testcase for composite emoji shortcode
20 lines
556 B
Ruby
20 lines
556 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe EmojiHelper, type: :helper do
|
|
describe '#emojify' do
|
|
it 'converts shortcodes to unicode' do
|
|
text = ':book: Book'
|
|
expect(emojify(text)).to eq '📖 Book'
|
|
end
|
|
|
|
it 'converts composite emoji shortcodes to unicode' do
|
|
text = ':couple_ww:'
|
|
expect(emojify(text)).to eq '👩❤👩'
|
|
end
|
|
|
|
it 'does not convert shortcodes that are part of a string into unicode' do
|
|
text = ':see_no_evil::hear_no_evil::speak_no_evil:'
|
|
expect(emojify(text)).to eq text
|
|
end
|
|
end
|
|
end
|