Unverified Commit 003672f0 authored by Dennis Schubert's avatar Dennis Schubert

Merge pull request #7011 from SuperTux88/fix-author-not-lowercase

Use Person.by_account_identifier to find the author
parents c124869d 1d508088
......@@ -180,7 +180,7 @@ module Diaspora
end
private_class_method def self.author_of(entity)
Person.find_by(diaspora_handle: entity.author)
Person.by_account_identifier(entity.author)
end
private_class_method def self.build_location(entity)
......
......@@ -585,6 +585,17 @@ describe Diaspora::Federation::Receive do
Diaspora::Federation::Receive.perform(status_message_entity)
end
it "finds the correct author if the author is not lowercase" do
status_message_entity = FactoryGirl.build(:status_message_entity, author: sender.diaspora_handle.upcase)
received = Diaspora::Federation::Receive.perform(status_message_entity)
status_message = StatusMessage.find_by!(guid: status_message_entity.guid)
expect(received).to eq(status_message)
expect(status_message.author).to eq(sender)
end
end
context "with poll" do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment