Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

24 行
768B

  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