0
0
Fork 0

Adding a bunch of tests

This commit is contained in:
Eugen Rochko 2016-02-26 15:28:08 +01:00
parent 44c5958203
commit f16b31f077
22 changed files with 439 additions and 105 deletions

View file

@ -54,10 +54,9 @@ class Status < ActiveRecord::Base
unless reblog?
self.text.scan(Account::MENTION_RE).each do |match|
uri = match.first
username = uri.split('@').first
domain = uri.split('@').size == 2 ? uri.split('@').last : nil
account = Account.find_by(username: username, domain: domain)
uri = match.first
username, domain = uri.split('@')
account = Account.find_by(username: username, domain: domain)
m << account unless account.nil?
end