Merge remote-tracking branch 'upstream/develop' into registration-workflow
[akkoma] / test / pleroma / web / pleroma_api / views / scrobble_view_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.PleromaAPI.ScrobbleViewTest do
6 use Pleroma.DataCase
7
8 alias Pleroma.Web.PleromaAPI.ScrobbleView
9
10 import Pleroma.Factory
11
12 test "successfully renders a Listen activity (pleroma extension)" do
13 listen_activity = insert(:listen)
14
15 status = ScrobbleView.render("show.json", activity: listen_activity)
16
17 assert status.length == listen_activity.data["object"]["length"]
18 assert status.title == listen_activity.data["object"]["title"]
19 end
20 end