projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
adding benchmarks in new format
[akkoma]
/
test
/
web
/
static_fe
/
static_fe_controller_test.exs
diff --git
a/test/web/static_fe/static_fe_controller_test.exs
b/test/web/static_fe/static_fe_controller_test.exs
index 430683ea076d74e867fdfca40953f6171645d0c4..a49ab002fcb665754d1741c0430ed9f08b461648 100644
(file)
--- a/
test/web/static_fe/static_fe_controller_test.exs
+++ b/
test/web/static_fe/static_fe_controller_test.exs
@@
-32,8
+32,8
@@
defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
end
test "profile does not include private messages", %{conn: conn, user: user} do
end
test "profile does not include private messages", %{conn: conn, user: user} do
- CommonAPI.post(user, %{
"status" =>
"public"})
- CommonAPI.post(user, %{
"status" => "private", "visibility" =>
"private"})
+ CommonAPI.post(user, %{
status:
"public"})
+ CommonAPI.post(user, %{
status: "private", visibility:
"private"})
conn = get(conn, "/users/#{user.nickname}")
conn = get(conn, "/users/#{user.nickname}")
@@
-44,7
+44,7
@@
defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
end
test "pagination", %{conn: conn, user: user} do
end
test "pagination", %{conn: conn, user: user} do
- Enum.map(1..30, fn i -> CommonAPI.post(user, %{
"status" =>
"test#{i}"}) end)
+ Enum.map(1..30, fn i -> CommonAPI.post(user, %{
status:
"test#{i}"}) end)
conn = get(conn, "/users/#{user.nickname}")
conn = get(conn, "/users/#{user.nickname}")
@@
-57,7
+57,7
@@
defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
end
test "pagination, page 2", %{conn: conn, user: user} do
end
test "pagination, page 2", %{conn: conn, user: user} do
- activities = Enum.map(1..30, fn i -> CommonAPI.post(user, %{
"status" =>
"test#{i}"}) end)
+ activities = Enum.map(1..30, fn i -> CommonAPI.post(user, %{
status:
"test#{i}"}) end)
{:ok, a11} = Enum.at(activities, 11)
conn = get(conn, "/users/#{user.nickname}?max_id=#{a11.id}")
{:ok, a11} = Enum.at(activities, 11)
conn = get(conn, "/users/#{user.nickname}?max_id=#{a11.id}")
@@
-77,7
+77,7
@@
defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
describe "notice html" do
test "single notice page", %{conn: conn, user: user} do
describe "notice html" do
test "single notice page", %{conn: conn, user: user} do
- {:ok, activity} = CommonAPI.post(user, %{
"status" =>
"testing a thing!"})
+ {:ok, activity} = CommonAPI.post(user, %{
status:
"testing a thing!"})
conn = get(conn, "/notice/#{activity.id}")
conn = get(conn, "/notice/#{activity.id}")
@@
-89,7
+89,7
@@
defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
test "filters HTML tags", %{conn: conn} do
user = insert(:user)
test "filters HTML tags", %{conn: conn} do
user = insert(:user)
- {:ok, activity} = CommonAPI.post(user, %{
"status" =>
"<script>alert('xss')</script>"})
+ {:ok, activity} = CommonAPI.post(user, %{
status:
"<script>alert('xss')</script>"})
conn =
conn
conn =
conn
@@
-101,11
+101,11
@@
defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
end
test "shows the whole thread", %{conn: conn, user: user} do
end
test "shows the whole thread", %{conn: conn, user: user} do
- {:ok, activity} = CommonAPI.post(user, %{
"status" =>
"space: the final frontier"})
+ {:ok, activity} = CommonAPI.post(user, %{
status:
"space: the final frontier"})
CommonAPI.post(user, %{
CommonAPI.post(user, %{
-
"status" =>
"these are the voyages or something",
-
"in_reply_to_status_id" =>
activity.id
+
status:
"these are the voyages or something",
+
in_reply_to_status_id:
activity.id
})
conn = get(conn, "/notice/#{activity.id}")
})
conn = get(conn, "/notice/#{activity.id}")
@@
-117,7
+117,7
@@
defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
test "redirect by AP object ID", %{conn: conn, user: user} do
{:ok, %Activity{data: %{"object" => object_url}}} =
test "redirect by AP object ID", %{conn: conn, user: user} do
{:ok, %Activity{data: %{"object" => object_url}}} =
- CommonAPI.post(user, %{
"status" =>
"beam me up"})
+ CommonAPI.post(user, %{
status:
"beam me up"})
conn = get(conn, URI.parse(object_url).path)
conn = get(conn, URI.parse(object_url).path)
@@
-126,7
+126,7
@@
defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
test "redirect by activity ID", %{conn: conn, user: user} do
{:ok, %Activity{data: %{"id" => id}}} =
test "redirect by activity ID", %{conn: conn, user: user} do
{:ok, %Activity{data: %{"id" => id}}} =
- CommonAPI.post(user, %{
"status" =>
"I'm a doctor, not a devops!"})
+ CommonAPI.post(user, %{
status:
"I'm a doctor, not a devops!"})
conn = get(conn, URI.parse(id).path)
conn = get(conn, URI.parse(id).path)
@@
-140,8
+140,7
@@
defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
end
test "404 for private status", %{conn: conn, user: user} do
end
test "404 for private status", %{conn: conn, user: user} do
- {:ok, activity} =
- CommonAPI.post(user, %{"status" => "don't show me!", "visibility" => "private"})
+ {:ok, activity} = CommonAPI.post(user, %{status: "don't show me!", visibility: "private"})
conn = get(conn, "/notice/#{activity.id}")
conn = get(conn, "/notice/#{activity.id}")
@@
-171,7
+170,7
@@
defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
end
test "it requires authentication if instance is NOT federating", %{conn: conn, user: user} do
end
test "it requires authentication if instance is NOT federating", %{conn: conn, user: user} do
- {:ok, activity} = CommonAPI.post(user, %{
"status" =>
"testing a thing!"})
+ {:ok, activity} = CommonAPI.post(user, %{
status:
"testing a thing!"})
ensure_federating_or_authenticated(conn, "/notice/#{activity.id}", user)
end
ensure_federating_or_authenticated(conn, "/notice/#{activity.id}", user)
end