Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

subscription_view_test.exs 768B

vor 4 Jahren
1234567891011121314151617181920212223
  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. defmodule Pleroma.Web.MastodonAPI.SubscriptionViewTest do
  5. use Pleroma.DataCase
  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