From f1f67c46c5b369476090429a46dbc646d772ae25 Mon Sep 17 00:00:00 2001 From: David Yip Date: Sat, 10 Feb 2018 10:32:14 -0600 Subject: Use Html2Text to generate plaintext for keyword mutes. #236. This allows us to match URLs inside link hrefs. --- spec/models/glitch/keyword_mute_helper_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec') diff --git a/spec/models/glitch/keyword_mute_helper_spec.rb b/spec/models/glitch/keyword_mute_helper_spec.rb index 9d09e58da..b3f991d5b 100644 --- a/spec/models/glitch/keyword_mute_helper_spec.rb +++ b/spec/models/glitch/keyword_mute_helper_spec.rb @@ -39,5 +39,12 @@ RSpec.describe Glitch::KeywordMuteHelper do expect(helper.matches?(status)).to be true end + + it 'matches link hrefs in HTML text' do + status = Fabricate(:status, text: '

yep

') + Glitch::KeywordMute.create!(account: alice, keyword: 'milk') + + expect(helper.matches?(status)).to be true + end end end -- cgit