Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F41646980
suggestion_controller_test.exs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
suggestion_controller_test.exs
View Options
# Pleroma: A lightweight social networking server
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma.Web.MastodonAPI.SuggestionControllerTest
do
use
Pleroma.Web.ConnCase
alias
Pleroma.Config
import
Pleroma.Factory
import
Tesla.Mock
setup
do
:
oauth_access
([
"read"
])
setup
%{
user
:
user
}
do
other_user
=
insert
(
:user
)
host
=
Config
.
get
([
Pleroma.Web.Endpoint
,
:url
,
:host
])
url500
=
"http://test500?
#{
host
}
&
#{
user
.
nickname
}
"
url200
=
"http://test200?
#{
host
}
&
#{
user
.
nickname
}
"
mock
(
fn
%{
method
:
:get
,
url
:
^
url500
}
->
%
Tesla.Env
{
status
:
500
,
body
:
"bad request"
}
%{
method
:
:get
,
url
:
^
url200
}
->
%
Tesla.Env
{
status
:
200
,
body
:
~s([{"acct":"yj455","avatar":"https://social.heldscal.la/avatar/201.jpeg","avatar_static":"https://social.heldscal.la/avatar/s/201.jpeg"}, {"acct":"
#{
other_user
.
ap_id
}
","avatar":"https://social.heldscal.la/avatar/202.jpeg","avatar_static":"https://social.heldscal.la/avatar/s/202.jpeg"}])
}
end
)
[
other_user
:
other_user
]
end
test
"returns empty result"
,
%{
conn
:
conn
}
do
res
=
conn
|>
get
(
"/api/v1/suggestions"
)
|>
json_response
(
200
)
assert
res
==
[]
end
end
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 15, 4:38 AM (18 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1043031
Default Alt Text
suggestion_controller_test.exs (1 KB)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment