From 69aa7c213a8aa1dfa54dbcfdab0c4b10ec415df8 Mon Sep 17 00:00:00 2001 From: Syldexia Date: Mon, 21 May 2018 22:32:28 +0100 Subject: Fixed test --- test/web/common_api/common_api_utils_test.exs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/web/common_api') 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 -- cgit v1.2.3 From 0b5bc62b33a655488afe73b35945adcbab11300d Mon Sep 17 00:00:00 2001 From: lain Date: Wed, 23 May 2018 17:25:24 +0200 Subject: Don't save double tags in AP objects we create This crashed Mastodon workers. --- test/web/common_api/common_api_test.exs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/web/common_api/common_api_test.exs (limited to 'test/web/common_api') 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..b597e6e0a --- /dev/null +++ b/test/web/common_api/common_api_test.exs @@ -0,0 +1,13 @@ +defmodule Pleroma.Web.CommonAPI.UtilsTest 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 -- cgit v1.2.3 From 5f06a1a3c51fcc2b3782879ed900e13266bfd18e Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 25 May 2018 03:14:49 +0000 Subject: testsuite: fix module name for CommonAPI.Test (was duplicated with CommonAPI.UtilsTest) --- test/web/common_api/common_api_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/web/common_api') diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index b597e6e0a..a5da271b3 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -1,4 +1,4 @@ -defmodule Pleroma.Web.CommonAPI.UtilsTest do +defmodule Pleroma.Web.CommonAPI.Test do use Pleroma.DataCase alias Pleroma.Web.CommonAPI -- cgit v1.2.3