Fix tests.
authoreal <eal@waifu.club>
Mon, 11 Dec 2017 16:41:03 +0000 (18:41 +0200)
committereal <eal@waifu.club>
Mon, 11 Dec 2017 16:41:03 +0000 (18:41 +0200)
test/web/mastodon_api/mastodon_api_controller_test.exs
test/web/twitter_api/twitter_api_test.exs

index fc00105695bcce4219a90b0d76c41acd4caa67a3..8bfad526517aab6437068b7816733351cd448733 100644 (file)
@@ -145,7 +145,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
       |> assign(:user, user)
       |> get("/api/v1/notifications")
 
-      expected_response = "hi <a href=\"#{user.ap_id}\">@#{user.nickname}</a>"
+      expected_response = "hi <span><a href=\"#{user.ap_id}\">@<span>#{user.nickname}</span></a></span>"
       assert [%{"status" => %{"content" => response}} | _rest] = json_response(conn, 200)
       assert response == expected_response
     end
@@ -161,7 +161,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
       |> assign(:user, user)
       |> get("/api/v1/notifications/#{notification.id}")
 
-      expected_response = "hi <a href=\"#{user.ap_id}\">@#{user.nickname}</a>"
+      expected_response = "hi <span><a href=\"#{user.ap_id}\">@<span>#{user.nickname}</span></a></span>"
       assert %{"status" => %{"content" => response}} = json_response(conn, 200)
       assert response == expected_response
     end
index 96552f97e075507dfc85b7b0a39d0cbf55df4698..823ba391322688950810bac42b9275b281c9c627 100644 (file)
@@ -34,7 +34,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
 
     { :ok, activity = %Activity{} } = TwitterAPI.create_status(user, input)
 
-    assert get_in(activity.data, ["object", "content"]) == "Hello again, <a href='shp'>@shp</a>.&lt;script&gt;&lt;/script&gt;<br>This is on another :moominmamma: line. #2hu #epic #phantasmagoric<br><a href=\"http://example.org/image.jpg\" class='attachment'>image.jpg</a>"
+    assert get_in(activity.data, ["object", "content"]) == "Hello again, <span><a href='shp'>@<span>shp</span></a></span>.&lt;script&gt;&lt;/script&gt;<br>This is on another :moominmamma: line. #2hu #epic #phantasmagoric<br><a href=\"http://example.org/image.jpg\" class='attachment'>image.jpg</a>"
     assert get_in(activity.data, ["object", "type"]) == "Note"
     assert get_in(activity.data, ["object", "actor"]) == user.ap_id
     assert get_in(activity.data, ["actor"]) == user.ap_id
@@ -291,7 +291,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
     archaeme_remote = insert(:user, %{nickname: "archaeme@archae.me"})
 
     mentions = Pleroma.Formatter.parse_mentions(text)
-    expected_text = "<a href='#{gsimg.ap_id}'>@gsimg</a> According to <a href='#{archaeme.ap_id}'>@archaeme</a>, that is @daggsy. Also hello <a href='#{archaeme_remote.ap_id}'>@archaeme</a>"
+    expected_text = "<span><a href='#{gsimg.ap_id}'>@<span>gsimg</span></a></span> According to <span><a href='#{archaeme.ap_id}'>@<span>archaeme</span></a></span>, that is @daggsy. Also hello <span><a href='#{archaeme_remote.ap_id}'>@<span>archaeme</span></a></span>"
 
     assert Utils.add_user_links(text, mentions) == expected_text
   end