diff options
author | David Yip <yipdw@member.fsf.org> | 2017-10-14 20:41:52 -0500 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2017-10-21 14:54:36 -0500 |
commit | 9f609bc94ec1bd933b4e302833027c3e4682c636 (patch) | |
tree | 996edf7f9c59ffb1037693b33ef30b018412270e /spec | |
parent | 603cf02b703a2df2ae6690077a3e21a5ce64b548 (diff) |
Fix case-insensitive match scenario; test some word ornamentation. #164.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/keyword_mute_spec.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/models/keyword_mute_spec.rb b/spec/models/keyword_mute_spec.rb index 211a9b4c6..de5d32bb4 100644 --- a/spec/models/keyword_mute_spec.rb +++ b/spec/models/keyword_mute_spec.rb @@ -51,7 +51,13 @@ RSpec.describe KeywordMute, type: :model do it 'matches if at least one keyword case-insensitively matches the text' do KeywordMute.create!(account: alice, keyword: 'hot') - expect(matcher =~ 'This is a hot take').to be_truthy + expect(matcher =~ 'This is a HOT take').to be_truthy + end + + it 'matches keywords surrounded by non-alphanumeric ornamentation' do + KeywordMute.create!(account: alice, keyword: 'hot') + + expect(matcher =~ 'This is a ~*HOT*~ take').to be_truthy end it 'uses case-folding rules appropriate for more than just English' do |