|> assign(:user, user)
|> patch("/api/v1/accounts/update_credentials", %{
"pleroma_settings_store" => %{
- soapbox_fe: %{
- themeMode: "bla"
+ masto_fe: %{
+ theme: "bla"
}
}
})
assert user_data["pleroma"]["settings_store"] ==
%{
"pleroma_fe" => %{"theme" => "bla"},
- "soapbox_fe" => %{"themeMode" => "bla"}
+ "masto_fe" => %{"theme" => "bla"}
}
user = Repo.get(User, user_data["id"])
|> assign(:user, user)
|> patch("/api/v1/accounts/update_credentials", %{
"pleroma_settings_store" => %{
- soapbox_fe: %{
- themeMode: "blub"
+ masto_fe: %{
+ theme: "blub"
}
}
})
assert user_data["pleroma"]["settings_store"] ==
%{
"pleroma_fe" => %{"theme" => "bla"},
- "soapbox_fe" => %{"themeMode" => "blub"}
+ "masto_fe" => %{"theme" => "blub"}
}
assert_called(Pleroma.Web.Federator.publish(:_))
assert user_data["locked"] == true
end
- test "updates the user's chat acceptance status", %{conn: conn} do
- conn = patch(conn, "/api/v1/accounts/update_credentials", %{accepts_chat_messages: "false"})
-
- assert user_data = json_response_and_validate_schema(conn, 200)
- assert user_data["pleroma"]["accepts_chat_messages"] == false
- end
-
test "updates the user's allow_following_move", %{user: user, conn: conn} do
assert user.allow_following_move == true
assert update_activity.data["object"]["name"] == "markorepairs"
end
+ test "updates the user's default post expiry", %{conn: conn} do
+ conn = patch(conn, "/api/v1/accounts/update_credentials", %{"status_ttl_days" => "1"})
+
+ assert user_data = json_response_and_validate_schema(conn, 200)
+ assert user_data["akkoma"]["status_ttl_days"] == 1
+ end
+
+ test "resets the user's default post expiry", %{conn: conn} do
+ conn = patch(conn, "/api/v1/accounts/update_credentials", %{"status_ttl_days" => "-1"})
+
+ assert user_data = json_response_and_validate_schema(conn, 200)
+ assert is_nil(user_data["akkoma"]["status_ttl_days"])
+ end
+
+ test "does not allow negative integers other than -1 for TTL", %{conn: conn} do
+ conn = patch(conn, "/api/v1/accounts/update_credentials", %{"status_ttl_days" => "-2"})
+
+ assert user_data = json_response_and_validate_schema(conn, 403)
+ end
+
test "updates the user's AKAs", %{conn: conn} do
conn =
patch(conn, "/api/v1/accounts/update_credentials", %{