From 63dbd875684b192e57d356a194c5d07ad98bd810 Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Tue, 8 Jan 2019 15:25:50 +0700 Subject: [PATCH] rename `post` to `status` --- lib/pleroma/user/info.ex | 6 +++--- test/web/activity_pub/activity_pub_test.exs | 4 ++-- test/web/common_api/common_api_test.exs | 14 ++++++------- .../mastodon_api_controller_test.exs | 20 +++++++++---------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/pleroma/user/info.ex b/lib/pleroma/user/info.ex index ffb800177..8ac50540d 100644 --- a/lib/pleroma/user/info.ex +++ b/lib/pleroma/user/info.ex @@ -202,14 +202,14 @@ defmodule Pleroma.User.Info do def add_pinnned_activity(info, %Pleroma.Activity{id: id}) do if id not in info.pinned_activities do - max_pinned_posts = Pleroma.Config.get([:instance, :max_pinned_posts], 0) + max_pinned_statuses = Pleroma.Config.get([:instance, :max_pinned_statuses], 0) params = %{pinned_activities: info.pinned_activities ++ [id]} info |> cast(params, [:pinned_activities]) |> validate_length(:pinned_activities, - max: max_pinned_posts, - message: "You have already pinned the maximum number of toots" + max: max_pinned_statuses, + message: "You have already pinned the maximum number of statuses" ) else change(info) diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs index 7d9febc47..325ef6636 100644 --- a/test/web/activity_pub/activity_pub_test.exs +++ b/test/web/activity_pub/activity_pub_test.exs @@ -601,8 +601,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do assert object end - test "returned pinned posts" do - Pleroma.Config.put([:instance, :max_pinned_posts], 3) + test "returned pinned statuses" do + Pleroma.Config.put([:instance, :max_pinned_statuses], 3) user = insert(:user) {:ok, activity_one} = CommonAPI.post(user, %{"status" => "HI!!!"}) diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 59beb3120..652b53099 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -97,9 +97,9 @@ defmodule Pleroma.Web.CommonAPI.Test do end end - describe "pinned posts" do - test "pin post" do - Pleroma.Config.put([:instance, :max_pinned_posts], 1) + describe "pinned statuses" do + test "pin status" do + Pleroma.Config.put([:instance, :max_pinned_statuses], 1) user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{"status" => "HI!!!"}) @@ -107,8 +107,8 @@ defmodule Pleroma.Web.CommonAPI.Test do assert {:ok, ^activity} = CommonAPI.pin(activity.id, user) end - test "max pinned posts" do - Pleroma.Config.put([:instance, :max_pinned_posts], 1) + test "max pinned statuses" do + Pleroma.Config.put([:instance, :max_pinned_statuses], 1) user = insert(:user) {:ok, activity_one} = CommonAPI.post(user, %{"status" => "HI!!!"}) @@ -122,8 +122,8 @@ defmodule Pleroma.Web.CommonAPI.Test do CommonAPI.pin(activity_two.id, user) end - test "unpin post" do - Pleroma.Config.put([:instance, :max_pinned_posts], 1) + test "unpin status" do + Pleroma.Config.put([:instance, :max_pinned_statuses], 1) user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{"status" => "HI!!!"}) diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 5ff7ef259..e7e42dd24 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -1472,9 +1472,9 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert user.info.settings == %{"programming" => "socks"} end - describe "pinned posts" do - test "returns pinned posts", %{conn: conn} do - Pleroma.Config.put([:instance, :max_pinned_posts], 1) + describe "pinned statuses" do + test "returns pinned statuses", %{conn: conn} do + Pleroma.Config.put([:instance, :max_pinned_statuses], 1) user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{"status" => "HI!!!"}) @@ -1492,8 +1492,8 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert [%{"id" => ^id_str}] = result end - test "pin post", %{conn: conn} do - Pleroma.Config.put([:instance, :max_pinned_posts], 1) + test "pin status", %{conn: conn} do + Pleroma.Config.put([:instance, :max_pinned_statuses], 1) user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{"status" => "HI!!!"}) @@ -1514,8 +1514,8 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> Jason.decode!() end - test "unpin post", %{conn: conn} do - Pleroma.Config.put([:instance, :max_pinned_posts], 1) + test "unpin status", %{conn: conn} do + Pleroma.Config.put([:instance, :max_pinned_statuses], 1) user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{"status" => "HI!!!"}) @@ -1539,8 +1539,8 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> Jason.decode!() end - test "max pinned posts", %{conn: conn} do - Pleroma.Config.put([:instance, :max_pinned_posts], 1) + test "max pinned statuses", %{conn: conn} do + Pleroma.Config.put([:instance, :max_pinned_statuses], 1) user = insert(:user) @@ -1558,7 +1558,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do user = User.get_by_ap_id(user.ap_id) - assert %{"error" => "You have already pinned the maximum number of toots"} = + assert %{"error" => "You have already pinned the maximum number of statuses"} = conn |> assign(:user, user) |> post("/api/v1/statuses/#{activity_two.id}/pin")