diff options
Diffstat (limited to 'test/web/controller/frontend')
-rw-r--r-- | test/web/controller/frontend/static_controller_test.exs | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/test/web/controller/frontend/static_controller_test.exs b/test/web/controller/frontend/static_controller_test.exs index 71da358a3..cc328ca64 100644 --- a/test/web/controller/frontend/static_controller_test.exs +++ b/test/web/controller/frontend/static_controller_test.exs @@ -36,8 +36,8 @@ defmodule Pleroma.Web.Frontend.StaticControllerTest 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, user_feed_path(conn, :feed_redirect, user.nickname)) @@ -48,7 +48,7 @@ defmodule Pleroma.Web.Frontend.StaticControllerTest do end test "pagination", %{conn: conn, user: user} do - Enum.each(1..30, &CommonAPI.post(user, %{"status" => "test#{&1}"})) + Enum.each(1..30, &CommonAPI.post(user, %{status: "test#{&1}"})) conn = get(conn, user_feed_path(conn, :feed_redirect, user.nickname)) html = html_response(conn, 200) @@ -60,7 +60,7 @@ defmodule Pleroma.Web.Frontend.StaticControllerTest 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, user_feed_path(conn, :feed_redirect, user.nickname, max_id: a11.id)) @@ -84,7 +84,7 @@ defmodule Pleroma.Web.Frontend.StaticControllerTest 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, o_status_path(conn, :notice, activity.id)) @@ -96,7 +96,7 @@ defmodule Pleroma.Web.Frontend.StaticControllerTest do 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 @@ -108,11 +108,11 @@ defmodule Pleroma.Web.Frontend.StaticControllerTest 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, %{ - "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, o_status_path(conn, :notice, activity.id)) @@ -124,7 +124,7 @@ defmodule Pleroma.Web.Frontend.StaticControllerTest do 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) @@ -133,7 +133,7 @@ defmodule Pleroma.Web.Frontend.StaticControllerTest do 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) @@ -147,8 +147,7 @@ defmodule Pleroma.Web.Frontend.StaticControllerTest 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, o_status_path(conn, :notice, activity.id)) @@ -178,7 +177,7 @@ defmodule Pleroma.Web.Frontend.StaticControllerTest 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, o_status_path(conn, :notice, activity.id), user) end |