Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Milan
diaspora
Commits
003672f0
Unverified
Commit
003672f0
authored
Aug 21, 2016
by
Dennis Schubert
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7011 from SuperTux88/fix-author-not-lowercase
Use Person.by_account_identifier to find the author
parents
c124869d
1d508088
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
lib/diaspora/federation/receive.rb
lib/diaspora/federation/receive.rb
+1
-1
spec/lib/diaspora/federation/receive_spec.rb
spec/lib/diaspora/federation/receive_spec.rb
+11
-0
No files found.
lib/diaspora/federation/receive.rb
View file @
003672f0
...
...
@@ -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
)
...
...
spec/lib/diaspora/federation/receive_spec.rb
View file @
003672f0
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment