summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-08-18 12:38:13 +0200
committerlain <lain@soykaf.club>2020-08-18 12:38:13 +0200
commit548ca43bcf9ed72a70bd98f074241dbb0e7801ec (patch)
treee32fafa13056d489c27a0b7a4afab6ca641b14ba /test/web/mastodon_api/controllers
parent7a273087ed7b49dedd821ca69a6e09d5f893c913 (diff)
parent34b099fffa64c20d42c417abb06e0e32a5ad296a (diff)
downloadpleroma-548ca43bcf9ed72a70bd98f074241dbb0e7801ec.tar.gz
pleroma-548ca43bcf9ed72a70bd98f074241dbb0e7801ec.zip
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into features/validators_use_ectotypes
Diffstat (limited to 'test/web/mastodon_api/controllers')
-rw-r--r--test/web/mastodon_api/controllers/timeline_controller_test.exs17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/timeline_controller_test.exs b/test/web/mastodon_api/controllers/timeline_controller_test.exs
index 50e0d783d..71bac99f7 100644
--- a/test/web/mastodon_api/controllers/timeline_controller_test.exs
+++ b/test/web/mastodon_api/controllers/timeline_controller_test.exs
@@ -445,6 +445,23 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
assert length(json_response(res_conn, 200)) == 2
end
+ test "with default settings on private instances, returns 403 for unauthenticated users", %{
+ conn: conn,
+ base_uri: base_uri,
+ error_response: error_response
+ } do
+ clear_config([:instance, :public], false)
+ clear_config([:restrict_unauthenticated, :timelines])
+
+ for local <- [true, false] do
+ res_conn = get(conn, "#{base_uri}?local=#{local}")
+
+ assert json_response(res_conn, :unauthorized) == error_response
+ end
+
+ ensure_authenticated_access(base_uri)
+ end
+
test "with `%{local: true, federated: true}`, returns 403 for unauthenticated users", %{
conn: conn,
base_uri: base_uri,