FIX: Discobot mention tutorial should be case insensitive.

This commit is contained in:
Guo Xiang Tan 2019-05-07 10:53:51 +08:00
parent e2bcf55077
commit 329969ea20
2 changed files with 5 additions and 2 deletions

View File

@ -69,7 +69,10 @@ module DiscourseNarrativeBot
valid = false valid = false
doc.css(".mention").each do |mention| doc.css(".mention").each do |mention|
valid = true if mention.text == "@#{self.discobot_user.username}" if mention.text.downcase == "@#{self.discobot_user.username}".downcase
valid = true
break
end
end end
valid valid

View File

@ -803,7 +803,7 @@ describe DiscourseNarrativeBot::NewUserNarrative do
it 'should create the right reply' do it 'should create the right reply' do
post.update!( post.update!(
raw: '@discobot hello how are you doing today?' raw: '@disCoBot hello how are you doing today?'
) )
narrative.expects(:enqueue_timeout_job).with(user) narrative.expects(:enqueue_timeout_job).with(user)