1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.MastodonAPI.SubscriptionViewTest do
6 use Pleroma.DataCase, async: true
8 alias Pleroma.Web.MastodonAPI.SubscriptionView, as: View
11 test "Represent a subscription" do
12 subscription = insert(:push_subscription, data: %{"alerts" => %{"mention" => true}})
15 alerts: %{"mention" => true},
16 endpoint: subscription.endpoint,
17 id: to_string(subscription.id),
18 server_key: Keyword.get(Push.vapid_config(), :public_key)
21 assert expected == View.render("show.json", %{subscription: subscription})