pleroma/test/web/websub/websub_controller_test.exs
2017-04-22 13:48:10 +02:00

24 lines
561 B
Elixir

defmodule Pleroma.Web.Websub.WebsubControllerTest do
use Pleroma.Web.ConnCase
import Pleroma.Factory
test "websub subscription request", %{conn: conn} do
user = insert(:user)
path = Pleroma.Web.OStatus.pubsub_path(user)
data = %{
"hub.callback": "http://example.org/sub",
"hub.mode": "subscribe",
"hub.topic": Pleroma.Web.OStatus.feed_path(user),
"hub.secret": "a random secret",
"hub.lease_seconds": "100"
}
conn = conn
|> post(path, data)
assert response(conn, 202) == "Accepted"
end
end