Test for and fix username case inconsistencies
This commit is contained in:
parent
e3a4d63847
commit
f0c440b884
2 changed files with 2 additions and 3 deletions
|
@ -84,8 +84,7 @@ module Ebooks
|
||||||
# Process mentions to figure out who to reply to
|
# Process mentions to figure out who to reply to
|
||||||
# i.e. not self and nobody who has seen too many secondary mentions
|
# i.e. not self and nobody who has seen too many secondary mentions
|
||||||
reply_mentions = @mentions.reject do |m|
|
reply_mentions = @mentions.reject do |m|
|
||||||
username = m.downcase
|
m.downcase == @bot.username.downcase || !@bot.conversation(ev).can_include?(m)
|
||||||
username == @bot.username || !@bot.conversation(ev).can_include?(username)
|
|
||||||
end
|
end
|
||||||
@reply_mentions = ([ev.user.screen_name] + reply_mentions).uniq
|
@reply_mentions = ([ev.user.screen_name] + reply_mentions).uniq
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ end
|
||||||
|
|
||||||
describe Ebooks::Bot do
|
describe Ebooks::Bot do
|
||||||
include Ebooks::Test
|
include Ebooks::Test
|
||||||
let(:bot) { TestBot.new('test_ebooks') }
|
let(:bot) { TestBot.new('Test_Ebooks') }
|
||||||
|
|
||||||
before { Timecop.freeze }
|
before { Timecop.freeze }
|
||||||
after { Timecop.return }
|
after { Timecop.return }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue