Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
15655d99
Commit
15655d99
authored
Apr 12, 2017
by
lain
Browse files
Fix user representation after following.
parent
b5e94bf9
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/twitter_api/twitter_api_controller.ex
View file @
15655d99
...
...
@@ -44,7 +44,7 @@ def friends_timeline(%{assigns: %{user: user}} = conn, params) do
end
def
follow
(%{
assigns:
%{
user:
user
}}
=
conn
,
%{
"user_id"
=>
followed_id
})
do
{
:ok
,
_
user
,
follower
,
_activity
}
=
TwitterAPI
.
follow
(
user
,
followed_id
)
{
:ok
,
user
,
follower
,
_activity
}
=
TwitterAPI
.
follow
(
user
,
followed_id
)
response
=
follower
|>
UserRepresenter
.
to_json
(%{
for:
user
})
...
...
test/web/twitter_api/twitter_api_controller_test.exs
View file @
15655d99
...
...
@@ -127,7 +127,7 @@ test "with credentials", %{conn: conn, user: current_user} do
current_user
=
Repo
.
get
(
User
,
current_user
.
id
)
assert
current_user
.
following
==
[
User
.
ap_followers
(
followed
)]
assert
json_response
(
conn
,
200
)
==
UserRepresenter
.
to_map
(
followed
)
assert
json_response
(
conn
,
200
)
==
UserRepresenter
.
to_map
(
followed
,
%{
for:
current_user
}
)
end
end
...
...
@@ -150,7 +150,7 @@ test "with credentials", %{conn: conn, user: current_user} do
current_user
=
Repo
.
get
(
User
,
current_user
.
id
)
assert
current_user
.
following
==
[]
assert
json_response
(
conn
,
200
)
==
UserRepresenter
.
to_map
(
followed
)
assert
json_response
(
conn
,
200
)
==
UserRepresenter
.
to_map
(
followed
,
%{
for:
current_user
}
)
end
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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