FIX: Bot mentioned check should be case insensitive.

This commit is contained in:
Guo Xiang Tan
2017-06-08 18:59:44 +09:00
parent 251aa8c5f9
commit 977bbb1f45
2 changed files with 12 additions and 2 deletions

View File

@ -427,6 +427,16 @@ describe DiscourseNarrativeBot::TrackSelector do
expect(new_post.raw).to eq(random_mention_reply)
end
it "should be case insensitive towards discobot's username" do
discobot_user.update!(username: 'DisCoBot')
post.update!(raw: 'Show me what you can do @discobot')
described_class.new(:reply, user, post_id: post.id).select
new_post = Post.last
expect(new_post.raw).to eq(random_mention_reply)
end
describe 'rate limiting random reply message in public topic' do
let(:topic) { Fabricate(:topic) }
let(:other_post) { Fabricate(:post, raw: '@discobot show me something', topic: topic) }