aboutsummaryrefslogtreecommitdiff
path: root/test/web/websub/websub_controller_test.exs
diff options
context:
space:
mode:
authordtluna <dtluna@openmailbox.org>2017-04-28 16:06:57 +0300
committerdtluna <dtluna@openmailbox.org>2017-04-28 16:06:57 +0300
commita9b2ad17596d1b6deca646239a95e94dc644ebf3 (patch)
tree9e086441831f33e191cd62b05b61ece0677491cc /test/web/websub/websub_controller_test.exs
parent28b203d08fe2e0d7afe3f3ec03a16cef62288b23 (diff)
parentfb5cebc1b5dcfd6af7fa1a81bc5b26275714fa26 (diff)
downloadpleroma-a9b2ad17596d1b6deca646239a95e94dc644ebf3.tar.gz
Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma into feature/unfollow-activity
Diffstat (limited to 'test/web/websub/websub_controller_test.exs')
-rw-r--r--test/web/websub/websub_controller_test.exs23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/web/websub/websub_controller_test.exs b/test/web/websub/websub_controller_test.exs
new file mode 100644
index 000000000..8368cafea
--- /dev/null
+++ b/test/web/websub/websub_controller_test.exs
@@ -0,0 +1,23 @@
+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