This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2017-07-14 10:47:53 -07:00
|
|
|
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
|
|
|
|
|
2017-07-26 16:02:15 -07:00
|
|
|
it 'converts composite emoji shortcodes to unicode' do
|
|
|
|
text = ':couple_ww:'
|
|
|
|
expect(emojify(text)).to eq '👩❤👩'
|
|
|
|
end
|
|
|
|
|
2017-07-14 10:47:53 -07:00
|
|
|
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
|