spc-pleroma/test/web/websub/websub_controller_test.exs

24 lines
561 B
Elixir
Raw Normal View History

2017-04-20 15:47:33 +00:00
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",
2017-04-20 15:47:33 +00:00
"hub.topic": Pleroma.Web.OStatus.feed_path(user),
"hub.secret": "a random secret",
2017-04-22 10:05:48 +00:00
"hub.lease_seconds": "100"
2017-04-20 15:47:33 +00:00
}
conn = conn
|> post(path, data)
assert response(conn, 202) == "Accepted"
end
end