The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 lines
556 B

  1. require 'rails_helper'
  2. RSpec.describe EmojiHelper, type: :helper do
  3. describe '#emojify' do
  4. it 'converts shortcodes to unicode' do
  5. text = ':book: Book'
  6. expect(emojify(text)).to eq '📖 Book'
  7. end
  8. it 'converts composite emoji shortcodes to unicode' do
  9. text = ':couple_ww:'
  10. expect(emojify(text)).to eq '👩❤👩'
  11. end
  12. it 'does not convert shortcodes that are part of a string into unicode' do
  13. text = ':see_no_evil::hear_no_evil::speak_no_evil:'
  14. expect(emojify(text)).to eq text
  15. end
  16. end
  17. end