1 defmodule Pleroma.Web.CommonAPI.UtilsTest do
2 alias Pleroma.Web.CommonAPI.Utils
3 alias Pleroma.Builders.{UserBuilder}
6 test "it adds attachment links to a given text and attachment set" do
8 "Sakura%20Mana%20%E2%80%93%20Turned%20on%20by%20a%20Senior%20OL%20with%20a%20Temptating%20Tight%20Skirt-s%20Full%20Hipline%20and%20Panty%20Shot-%20Beautiful%20Thick%20Thighs-%20and%20Erotic%20Ass-%20-2015-%20--%20Oppaitime%208-28-2017%206-50-33%20PM.png"
11 "url" => [%{"href" => name}]
14 res = Utils.add_attachments("", [attachment])
17 "<br><a href=\"#{name}\" class='attachment'>Sakura Mana – Turned on by a Se…</a>"
20 describe "it confirms the password given is the current users password" do
21 test "incorrect password given" do
22 {:ok, user} = UserBuilder.insert()
24 assert Utils.confirm_current_password(user, "") == {:error, "Invalid password."}
27 test "correct password given" do
28 {:ok, user} = UserBuilder.insert()
29 assert Utils.confirm_current_password(user, "test") == {:ok, user}