Merge remote-tracking branch 'glitchsoc/master' into 454-allow-keyword-mutes-to-skip-mentions

Conflicts:
 	app/models/glitch/keyword_mute.rb
This commit is contained in:
David Yip
2018-06-12 16:39:30 -05:00
100 changed files with 477 additions and 486 deletions

View File

@ -81,12 +81,18 @@ RSpec.describe Glitch::KeywordMute, type: :model do
expect(matcher.matches?('(hot take)', Unscoped)).to be_truthy
end
it 'escapes metacharacters in keywords' do
it 'escapes metacharacters in whole-word keywords' do
Glitch::KeywordMute.create!(account: alice, keyword: '(hot take)')
expect(matcher.matches?('(hot take)', Unscoped)).to be_truthy
end
it 'escapes metacharacters in non-whole-word keywords' do
Glitch::KeywordMute.create!(account: alice, keyword: '(-', whole_word: false)
expect(matcher.matches?('bad (-)')).to be_truthy
end
it 'uses case-folding rules appropriate for more than just English' do
Glitch::KeywordMute.create!(account: alice, keyword: 'großeltern')