Add basic Ostatus user representer.
This commit is contained in:
parent
ce6cc84a4a
commit
36e883cd4b
4 changed files with 39 additions and 5 deletions
17
test/web/ostatus/user_representer_test.exs
Normal file
17
test/web/ostatus/user_representer_test.exs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
defmodule Pleroma.Web.OStatus.UserRepresenterTest do
|
||||
use Pleroma.DataCase
|
||||
alias Pleroma.Web.OStatus.UserRepresenter
|
||||
|
||||
import Pleroma.Factory
|
||||
|
||||
test "returns a user with id, uri, name and link" do
|
||||
user = build(:user)
|
||||
tuple = UserRepresenter.to_tuple(user)
|
||||
{:author, author} = tuple
|
||||
|
||||
[:id, :uri, :name, :link]
|
||||
|> Enum.each(fn (tag) ->
|
||||
assert Enum.find(author, fn(e) -> tag == elem(e, 0) end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue