X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fformatter_test.exs;h=c76149e38e4be43a77c09d0e222e8f7a3a1302d5;hb=da4b670451fcc41b960aeb33adb9f0184ba599cf;hp=cfa735795f55b6fac2f0947d0903462aa0305778;hpb=8a67677d7791287905898bc388fbd8d9c81ec2b1;p=akkoma diff --git a/test/formatter_test.exs b/test/formatter_test.exs index cfa735795..c76149e38 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2018 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.FormatterTest do alias Pleroma.Formatter alias Pleroma.User @@ -27,7 +31,7 @@ defmodule Pleroma.FormatterTest do text = "Fact #3: pleroma does what mastodon't" expected_text = - "Fact #3: pleroma does what mastodon't" + "Fact : pleroma does what mastodon't" tags = Formatter.parse_tags(text) @@ -215,8 +219,11 @@ defmodule Pleroma.FormatterTest do end test "it can parse mentions and return the relevant users" do - text = "@gsimg According to @archaeme, that is @daggsy. Also hello @archaeme@archae.me" + text = + "@@gsimg According to @archaeme, that is @daggsy. Also hello @archaeme@archae.me and @o and @@@jimm" + o = insert(:user, %{nickname: "o"}) + jimm = insert(:user, %{nickname: "jimm"}) gsimg = insert(:user, %{nickname: "gsimg"}) archaeme = insert(:user, %{nickname: "archaeme"}) archaeme_remote = insert(:user, %{nickname: "archaeme@archae.me"}) @@ -224,7 +231,9 @@ defmodule Pleroma.FormatterTest do expected_result = [ {"@gsimg", gsimg}, {"@archaeme", archaeme}, - {"@archaeme@archae.me", archaeme_remote} + {"@archaeme@archae.me", archaeme_remote}, + {"@o", o}, + {"@jimm", jimm} ] assert Formatter.parse_mentions(text) == expected_result