]> cat aescling's git repositories - mastodon.git/commitdiff
Fix case-insensitive match scenario; test some word ornamentation. #164.
authorDavid Yip <yipdw@member.fsf.org>
Sun, 15 Oct 2017 01:41:52 +0000 (20:41 -0500)
committerDavid Yip <yipdw@member.fsf.org>
Sat, 21 Oct 2017 19:54:36 +0000 (14:54 -0500)
spec/models/keyword_mute_spec.rb

index 211a9b4c61ec5896e28c24e2eea21a6354c29414..de5d32bb42712768f4d2613b1155fc32aecf89c1 100644 (file)
@@ -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
This page took 0.023325 seconds and 3 git commands to generate.