1 defmodule Pleroma.Web.Websub.WebsubControllerTest do
2 use Pleroma.Web.ConnCase
5 alias Pleroma.Web.Websub.WebsubServerSubscription
7 test "websub subscription request", %{conn: conn} do
10 path = Pleroma.Web.OStatus.pubsub_path(user)
13 "hub.callback": "http://example.org/sub",
14 "hub.mode": "subscription",
15 "hub.topic": Pleroma.Web.OStatus.feed_path(user),
16 "hub.secret": "a random secret",
17 "hub.lease_seconds": "100"
23 assert response(conn, 202) == "Accepted"
24 subscription = Repo.one!(WebsubServerSubscription)
25 assert subscription.topic == Pleroma.Web.OStatus.feed_path(user)
26 assert subscription.state == "requested"
27 assert subscription.secret == "a random secret"
28 assert subscription.callback == "http://example.org/sub"
29 assert subscription.valid_until == NaiveDateTime.add(subscription.inserted_at, 100)