From 2c11e95efd65d8d26b60283d30bde8eda2b9a4ab Mon Sep 17 00:00:00 2001 From: David Yip Date: Sat, 14 Oct 2017 20:41:52 -0500 Subject: [PATCH] Fix case-insensitive match scenario; test some word ornamentation. #164. --- spec/models/keyword_mute_spec.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/models/keyword_mute_spec.rb b/spec/models/keyword_mute_spec.rb index 211a9b4c61..de5d32bb42 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