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.

25 lines
582 B

  1. require 'rails_helper'
  2. RSpec.describe CustomEmoji, type: :model do
  3. describe '.from_text' do
  4. let!(:emojo) { Fabricate(:custom_emoji) }
  5. subject { described_class.from_text(text, nil) }
  6. context 'with plain text' do
  7. let(:text) { 'Hello :coolcat:' }
  8. it 'returns records used via shortcodes in text' do
  9. is_expected.to include(emojo)
  10. end
  11. end
  12. context 'with html' do
  13. let(:text) { '<p>Hello :coolcat:</p>' }
  14. it 'returns records used via shortcodes in text' do
  15. is_expected.to include(emojo)
  16. end
  17. end
  18. end
  19. end