diff options
author | beatrix <beatrix.bitrot@gmail.com> | 2017-09-28 21:48:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-28 21:48:28 -0400 |
commit | c027a7bd4d7b5af21f4b201d656f7251fa3606a1 (patch) | |
tree | ce2c2327b26358c26cb899ea918988af373ca6d6 /spec/models/custom_emoji_spec.rb | |
parent | 210e6776fce016666ecfd248b2208c487f3440f9 (diff) | |
parent | 53f829dfa8bc376041a442dc84c22aa1cbfcb9d0 (diff) |
Merge pull request #157 from glitch-soc/merging-upstream
ABRACA-HRRRRRRRRRRRNGGGGGGGHHH!!!!!!!!!!!!!!!!!!!
Diffstat (limited to 'spec/models/custom_emoji_spec.rb')
-rw-r--r-- | spec/models/custom_emoji_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/models/custom_emoji_spec.rb b/spec/models/custom_emoji_spec.rb new file mode 100644 index 000000000..cb51e9519 --- /dev/null +++ b/spec/models/custom_emoji_spec.rb @@ -0,0 +1,25 @@ +require 'rails_helper' + +RSpec.describe CustomEmoji, type: :model do + describe '.from_text' do + let!(:emojo) { Fabricate(:custom_emoji) } + + subject { described_class.from_text(text, nil) } + + context 'with plain text' do + let(:text) { 'Hello :coolcat:' } + + it 'returns records used via shortcodes in text' do + is_expected.to include(emojo) + end + end + + context 'with html' do + let(:text) { '<p>Hello :coolcat:</p>' } + + it 'returns records used via shortcodes in text' do + is_expected.to include(emojo) + end + end + end +end |