params = Map.put(params, :last_refreshed_at, NaiveDateTime.utc_now())
- params = if remote?, do: truncate_fields_param(params), else: params
+ params =
+ if remote? do
+ params
+ |> truncate_fields_param()
+ |> truncate_if_exists(:name, name_limit)
+ |> truncate_if_exists(:bio, bio_limit)
+ else
+ params
+ end
struct
|> cast(
assert fetched_user == "not found nonexistant"
end
+ clear_config([:instance, :user_bio_length])
+
test "updates an existing user, if stale" do
+ Pleroma.Config.put([:instance, :user_bio_length], 1)
a_week_ago = NaiveDateTime.add(NaiveDateTime.utc_now(), -604_800)
orig_user =
end
describe "/inbox" do
+ clear_config([:instance, :user_bio_length])
+
test "it inserts an incoming activity into the database", %{conn: conn} do
+ Pleroma.Config.put([:instance, :user_bio_length], 1)
+
data = File.read!("test/fixtures/mastodon-post-activity.json") |> Poison.decode!()
conn =
defmodule Pleroma.Web.MastodonAPI.SuggestionControllerTest do
use Pleroma.Web.ConnCase
- alias Pleroma.Config
-
setup do: oauth_access(["read"])
test "returns empty result", %{conn: conn} do