projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update mastofe paths (#95)
[akkoma]
/
test
/
pleroma
/
web
/
mastodon_api
/
controllers
/
timeline_controller_test.exs
diff --git
a/test/pleroma/web/mastodon_api/controllers/timeline_controller_test.exs
b/test/pleroma/web/mastodon_api/controllers/timeline_controller_test.exs
index 89225b95d921154cf8ea48c1c83a94d6c6d3dd12..187982d92572b42b0cb21552bbc353de94aa6132 100644
(file)
--- a/
test/pleroma/web/mastodon_api/controllers/timeline_controller_test.exs
+++ b/
test/pleroma/web/mastodon_api/controllers/timeline_controller_test.exs
@@
-923,10
+923,10
@@
defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
%{conn: auth_conn} = oauth_access(["read:statuses"])
res_conn = get(auth_conn, "#{base_uri}?local=true")
%{conn: auth_conn} = oauth_access(["read:statuses"])
res_conn = get(auth_conn, "#{base_uri}?local=true")
- assert length(json_response(res_conn, 200)) == 1
+ assert length(json_response
_and_validate_schema
(res_conn, 200)) == 1
res_conn = get(auth_conn, "#{base_uri}?local=false")
res_conn = get(auth_conn, "#{base_uri}?local=false")
- assert length(json_response(res_conn, 200)) == 2
+ assert length(json_response
_and_validate_schema
(res_conn, 200)) == 2
end
test "with default settings on private instances, returns 403 for unauthenticated users", %{
end
test "with default settings on private instances, returns 403 for unauthenticated users", %{
@@
-940,7
+940,7
@@
defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
for local <- [true, false] do
res_conn = get(conn, "#{base_uri}?local=#{local}")
for local <- [true, false] do
res_conn = get(conn, "#{base_uri}?local=#{local}")
- assert json_response(res_conn, :unauthorized) == error_response
+ assert json_response
_and_validate_schema
(res_conn, :unauthorized) == error_response
end
ensure_authenticated_access(base_uri)
end
ensure_authenticated_access(base_uri)
@@
-957,7
+957,7
@@
defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
for local <- [true, false] do
res_conn = get(conn, "#{base_uri}?local=#{local}")
for local <- [true, false] do
res_conn = get(conn, "#{base_uri}?local=#{local}")
- assert json_response(res_conn, :unauthorized) == error_response
+ assert json_response
_and_validate_schema
(res_conn, :unauthorized) == error_response
end
ensure_authenticated_access(base_uri)
end
ensure_authenticated_access(base_uri)
@@
-969,10
+969,10
@@
defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
clear_config([:restrict_unauthenticated, :timelines, :federated], true)
res_conn = get(conn, "#{base_uri}?local=true")
clear_config([:restrict_unauthenticated, :timelines, :federated], true)
res_conn = get(conn, "#{base_uri}?local=true")
- assert length(json_response(res_conn, 200)) == 1
+ assert length(json_response
_and_validate_schema
(res_conn, 200)) == 1
res_conn = get(conn, "#{base_uri}?local=false")
res_conn = get(conn, "#{base_uri}?local=false")
- assert json_response(res_conn, :unauthorized) == error_response
+ assert json_response
_and_validate_schema
(res_conn, :unauthorized) == error_response
ensure_authenticated_access(base_uri)
end
ensure_authenticated_access(base_uri)
end
@@
-984,11
+984,11
@@
defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
clear_config([:restrict_unauthenticated, :timelines, :federated], false)
res_conn = get(conn, "#{base_uri}?local=true")
clear_config([:restrict_unauthenticated, :timelines, :federated], false)
res_conn = get(conn, "#{base_uri}?local=true")
- assert json_response(res_conn, :unauthorized) == error_response
+ assert json_response
_and_validate_schema
(res_conn, :unauthorized) == error_response
# Note: local activities get delivered as part of federated timeline
res_conn = get(conn, "#{base_uri}?local=false")
# Note: local activities get delivered as part of federated timeline
res_conn = get(conn, "#{base_uri}?local=false")
- assert length(json_response(res_conn, 200)) == 2
+ assert length(json_response
_and_validate_schema
(res_conn, 200)) == 2
ensure_authenticated_access(base_uri)
end
ensure_authenticated_access(base_uri)
end