Test cases for local_timeline_available option

This commit is contained in:
Ruby Iris Juric 2024-09-21 16:07:13 +10:00
parent d15e9ef6e6
commit dc2f0d3b53
Signed by: srxl
GPG key ID: B6D7116C451A5B41

View file

@ -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()