forked from AkkomaGang/akkoma
Test cases for local_timeline_available option
This commit is contained in:
parent
d15e9ef6e6
commit
dc2f0d3b53
1 changed files with 21 additions and 2 deletions
|
@ -409,7 +409,7 @@ test "should not return local-only posts for anonymous users" do
|
|||
assert [] = result
|
||||
end
|
||||
|
||||
test "should return 404 if disabled" do
|
||||
test "should return 404 if federated timeline disabled" do
|
||||
clear_config([:instance, :federated_timeline_available], false)
|
||||
|
||||
result =
|
||||
|
@ -420,7 +420,26 @@ test "should return 404 if disabled" do
|
|||
assert %{"error" => "Federated timeline is disabled"} = result
|
||||
end
|
||||
|
||||
test "should not return 404 if local is specified" do
|
||||
test "should not return 404 if local timeline disabled" do
|
||||
clear_config([:instance, :local_timeline_available], false)
|
||||
|
||||
build_conn()
|
||||
|> get("/api/v1/timelines/public")
|
||||
|> json_response_and_validate_schema(200)
|
||||
end
|
||||
|
||||
test "should return 404 if local is specified and local timeline disabled" do
|
||||
clear_config([:instance, :local_timeline_available], false)
|
||||
|
||||
result =
|
||||
build_conn()
|
||||
|> get("/api/v1/timelines/public?local=true")
|
||||
|> json_response_and_validate_schema(404)
|
||||
|
||||
assert %{"error" => "Local timeline is disabled"} = result
|
||||
end
|
||||
|
||||
test "should not return 404 if local is specified and federated timeline disabled" do
|
||||
clear_config([:instance, :federated_timeline_available], false)
|
||||
|
||||
build_conn()
|
||||
|
|
Loading…
Reference in a new issue