diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2018-12-13 15:13:02 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2018-12-14 22:09:04 +0300 |
commit | d3ec09bb380bb990bea6edc5dae6bbda7f2322c5 (patch) | |
tree | 82ace98293e3da35f633e417e9c217fe69c1c4f5 /test | |
parent | 91236c60c7aa266c1e874ebdd2aa44becfc6709b (diff) | |
download | pleroma-d3ec09bb380bb990bea6edc5dae6bbda7f2322c5.tar.gz pleroma-d3ec09bb380bb990bea6edc5dae6bbda7f2322c5.zip |
fix tags
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/status_view_test.exs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs index d10d59d6c..4f9805c78 100644 --- a/test/web/mastodon_api/status_view_test.exs +++ b/test/web/mastodon_api/status_view_test.exs @@ -62,7 +62,12 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do visibility: "public", media_attachments: [], mentions: [], - tags: note.data["object"]["tag"], + tags: [ + %{ + name: "#{note.data["object"]["tag"]}", + url: "/tag/#{note.data["object"]["tag"]}" + } + ], application: %{ name: "Web", website: nil @@ -151,4 +156,14 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do assert represented[:reblog][:id] == to_string(activity.id) assert represented[:emojis] == [] end + + describe "build_tags/1" do + test "it returns a a dictionary tags" do + assert StatusView.build_tags(["fediverse", "mastodon", "nextcloud"]) == [ + %{name: "fediverse", url: "/tag/fediverse"}, + %{name: "mastodon", url: "/tag/mastodon"}, + %{name: "nextcloud", url: "/tag/nextcloud"} + ] + end + end end |