diff options
author | href <href+git-pleroma@random.sh> | 2018-12-14 20:20:30 +0000 |
---|---|---|
committer | href <href+git-pleroma@random.sh> | 2018-12-14 20:20:30 +0000 |
commit | acec11626d2bb61c3728d634b04ac5afeaf4b17b (patch) | |
tree | ec90d7a92caec4981aacfc509f8eddca18d3393d /test | |
parent | 980131b4db4f2da319d9054889bdb962aa8c837e (diff) | |
parent | ea72ac549b2ac52623462d6862154fb6f800c01c (diff) | |
download | pleroma-acec11626d2bb61c3728d634b04ac5afeaf4b17b.tar.gz pleroma-acec11626d2bb61c3728d634b04ac5afeaf4b17b.zip |
Merge branch 'fix/issue_272' into 'develop'
[#272] fix tags
See merge request pleroma/pleroma!540
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/status_view_test.exs | 28 |
1 files changed, 27 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..b7ac92760 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,25 @@ 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 + object_tags = [ + "fediverse", + "mastodon", + "nextcloud", + %{ + "href" => "https://kawen.space/users/lain", + "name" => "@lain@kawen.space", + "type" => "Mention" + } + ] + + assert StatusView.build_tags(object_tags) == [ + %{name: "fediverse", url: "/tag/fediverse"}, + %{name: "mastodon", url: "/tag/mastodon"}, + %{name: "nextcloud", url: "/tag/nextcloud"} + ] + end + end end |