diff options
author | David Yip <yipdw@member.fsf.org> | 2017-11-15 17:26:29 -0600 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2017-11-15 18:12:29 -0600 |
commit | cb4ef24ac9d48e70648135f106fdc275dedf14fc (patch) | |
tree | e27e76ca2152cd47cf426a7c7daf6f68bdca54c8 /spec/models/glitch | |
parent | 431503bae2dc6e12bdade7d5d20f707112c2f7c2 (diff) |
Match keyword mute filter on hashtags. #208.
It is reasonable to expect someone to enter #foo to mute hashtag #foo. However, tags are recorded on statuses without the preceding #. To adjust for this, we build a separate tag matcher and use Tag::HASHTAG_RE to extract a hashtag from the hashtag syntax.
Diffstat (limited to 'spec/models/glitch')
-rw-r--r-- | spec/models/glitch/keyword_mute_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/models/glitch/keyword_mute_spec.rb b/spec/models/glitch/keyword_mute_spec.rb index 9685c6493..e14af0e6a 100644 --- a/spec/models/glitch/keyword_mute_spec.rb +++ b/spec/models/glitch/keyword_mute_spec.rb @@ -4,8 +4,8 @@ RSpec.describe Glitch::KeywordMute, type: :model do let(:alice) { Fabricate(:account, username: 'alice').tap(&:save!) } let(:bob) { Fabricate(:account, username: 'bob').tap(&:save!) } - describe '.matcher_for' do - let(:matcher) { Glitch::KeywordMute.matcher_for(alice) } + describe '.text_matcher_for' do + let(:matcher) { Glitch::KeywordMute.text_matcher_for(alice.id) } describe 'with no mutes' do before do |