logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

subscription_view_test.exs (781B)


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