diff options
author | lain <lain@soykaf.club> | 2018-05-26 16:00:59 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-05-26 16:00:59 +0200 |
commit | 4b3ec5351466f8615b32e62cc4e6215f8a80b105 (patch) | |
tree | e46842eac5d8255858a113f71bdf42bfd75e4436 /test/web/common_api | |
parent | 4fd9df100f61dfe4731934eca86500472d866f60 (diff) | |
parent | 6138b297836f459e4fe5d21dfed30ddd9397b6d4 (diff) | |
download | pleroma-4b3ec5351466f8615b32e62cc4e6215f8a80b105.tar.gz pleroma-4b3ec5351466f8615b32e62cc4e6215f8a80b105.zip |
Merge branch 'develop' into csaurus/pleroma-feature/mstdn-direct-api
Diffstat (limited to 'test/web/common_api')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 13 | ||||
-rw-r--r-- | test/web/common_api/common_api_utils_test.exs | 5 |
2 files changed, 15 insertions, 3 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs new file mode 100644 index 000000000..a5da271b3 --- /dev/null +++ b/test/web/common_api/common_api_test.exs @@ -0,0 +1,13 @@ +defmodule Pleroma.Web.CommonAPI.Test do + use Pleroma.DataCase + alias Pleroma.Web.CommonAPI + + import Pleroma.Factory + + test "it de-duplicates tags" do + user = insert(:user) + {:ok, activity} = CommonAPI.post(user, %{"status" => "#2hu #2HU"}) + + assert activity.data["object"]["tag"] == ["2hu"] + end +end diff --git a/test/web/common_api/common_api_utils_test.exs b/test/web/common_api/common_api_utils_test.exs index 23cce471f..f39472ee3 100644 --- a/test/web/common_api/common_api_utils_test.exs +++ b/test/web/common_api/common_api_utils_test.exs @@ -21,13 +21,12 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do test "incorrect password given" do {:ok, user} = UserBuilder.insert() - assert Utils.confirm_current_password(user, %{"password" => ""}) == - {:error, "Invalid password."} + assert Utils.confirm_current_password(user, "") == {:error, "Invalid password."} end test "correct password given" do {:ok, user} = UserBuilder.insert() - assert Utils.confirm_current_password(user, %{"password" => "test"}) == {:ok, user} + assert Utils.confirm_current_password(user, "test") == {:ok, user} end end end |