diff options
author | kaniini <nenolod@gmail.com> | 2018-11-01 09:10:51 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2018-11-01 09:10:51 +0000 |
commit | eba9a62024a6acd4722745850cb7c0ea0502304f (patch) | |
tree | 0718445dc136d70c7a3182c5e130062da0e3c26d /test/web/activity_pub | |
parent | 40676d768307d43de075f6ced5231120bf89cbd1 (diff) | |
parent | 1e9ced5af478ba38c9e9d46140891a8f4473e02d (diff) | |
download | pleroma-eba9a62024a6acd4722745850cb7c0ea0502304f.tar.gz pleroma-eba9a62024a6acd4722745850cb7c0ea0502304f.zip |
Merge branch 'feature/relay-tests' into 'develop'
relay tests
See merge request pleroma/pleroma!411
Diffstat (limited to 'test/web/activity_pub')
-rw-r--r-- | test/web/activity_pub/activity_pub_controller_test.exs | 23 | ||||
-rw-r--r-- | test/web/activity_pub/relay_test.exs | 11 |
2 files changed, 34 insertions, 0 deletions
diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs index e63cd6583..5b46bbe76 100644 --- a/test/web/activity_pub/activity_pub_controller_test.exs +++ b/test/web/activity_pub/activity_pub_controller_test.exs @@ -4,6 +4,29 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do alias Pleroma.Web.ActivityPub.{UserView, ObjectView} alias Pleroma.{Repo, User} alias Pleroma.Activity + alias Pleroma.Config + + describe "/relay" do + test "with the relay active, it returns the relay user", %{conn: conn} do + Config.put([:instance, :allow_relay], true) + + res = + conn + |> get(activity_pub_path(conn, :relay)) + |> json_response(200) + + assert res["id"] =~ "/relay" + end + + test "with the relay disabled, it returns 404", %{conn: conn} do + Config.put([:instance, :allow_relay], false) + + res = + conn + |> get(activity_pub_path(conn, :relay)) + |> json_response(404) + end + end describe "/users/:nickname" do test "it returns a json representation of the user", %{conn: conn} do diff --git a/test/web/activity_pub/relay_test.exs b/test/web/activity_pub/relay_test.exs new file mode 100644 index 000000000..41d13e055 --- /dev/null +++ b/test/web/activity_pub/relay_test.exs @@ -0,0 +1,11 @@ +defmodule Pleroma.Web.ActivityPub.RelayTest do + use Pleroma.DataCase + + alias Pleroma.Web.ActivityPub.Relay + + test "gets an actor for the relay" do + user = Relay.get_actor() + + assert user.ap_id =~ "/relay" + end +end |