X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fostatus%2Fuser_representer_test.exs;h=a4afc2cf78efbb0badb543f2bb249167fac4c165;hb=6843755834192c671aebece505a1ab9322e57eee;hp=02a4b5b141e6beb3e51559835c72efed7533dfc0;hpb=361a8c42197a92f044fc3d0ceadeee5e3590e96f;p=akkoma
diff --git a/test/web/ostatus/user_representer_test.exs b/test/web/ostatus/user_representer_test.exs
index 02a4b5b14..a4afc2cf7 100644
--- a/test/web/ostatus/user_representer_test.exs
+++ b/test/web/ostatus/user_representer_test.exs
@@ -3,15 +3,29 @@ defmodule Pleroma.Web.OStatus.UserRepresenterTest do
alias Pleroma.Web.OStatus.UserRepresenter
import Pleroma.Factory
+ alias Pleroma.User
test "returns a user with id, uri, name and link" do
- user = build(:user)
- tuple = UserRepresenter.to_tuple(user)
- {:author, author} = tuple
+ user = build(:user, nickname: "ã¬ã¤ã³")
+ tuple = UserRepresenter.to_simple_form(user)
- [:id, :uri, :name, :link]
- |> Enum.each(fn (tag) ->
- assert Enum.find(author, fn(e) -> tag == elem(e, 0) end)
- end)
+ res = :xmerl.export_simple_content(tuple, :xmerl_xml) |> to_string
+
+ expected = """
+ #{user.ap_id}
+ http://activitystrea.ms/schema/1.0/person
+ #{user.ap_id}
+ #{user.nickname}
+ #{user.name}
+ #{user.bio}
+ #{user.nickname}
+
+ """
+
+ assert clean(res) == clean(expected)
+ end
+
+ defp clean(string) do
+ String.replace(string, ~r/\s/, "")
end
end