summaryrefslogtreecommitdiff
path: root/test/web/activity_pub/activity_pub_controller_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2018-03-30 15:01:53 +0200
committerlain <lain@soykaf.club>2018-03-30 15:01:53 +0200
commit4afbef39f49948ddd3b1cd1bbda58ff7e3ac2785 (patch)
tree6959e12d9058c981f3b69c77b8b0290049651cd6 /test/web/activity_pub/activity_pub_controller_test.exs
parent480932c8e524e1a80c9c8ef1a1aa23379f633afe (diff)
downloadpleroma-4afbef39f49948ddd3b1cd1bbda58ff7e3ac2785.tar.gz
pleroma-4afbef39f49948ddd3b1cd1bbda58ff7e3ac2785.zip
Format the code.
Diffstat (limited to 'test/web/activity_pub/activity_pub_controller_test.exs')
-rw-r--r--test/web/activity_pub/activity_pub_controller_test.exs27
1 files changed, 15 insertions, 12 deletions
diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs
index c8082cd03..28d765d83 100644
--- a/test/web/activity_pub/activity_pub_controller_test.exs
+++ b/test/web/activity_pub/activity_pub_controller_test.exs
@@ -9,9 +9,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
test "it returns a json representation of the user", %{conn: conn} do
user = insert(:user)
- conn = conn
- |> put_req_header("accept", "application/activity+json")
- |> get("/users/#{user.nickname}")
+ conn =
+ conn
+ |> put_req_header("accept", "application/activity+json")
+ |> get("/users/#{user.nickname}")
user = Repo.get(User, user.id)
@@ -22,11 +23,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
describe "/object/:uuid" do
test "it returns a json representation of the object", %{conn: conn} do
note = insert(:note)
- uuid = String.split(note.data["id"], "/") |> List.last
+ uuid = String.split(note.data["id"], "/") |> List.last()
- conn = conn
- |> put_req_header("accept", "application/activity+json")
- |> get("/objects/#{uuid}")
+ conn =
+ conn
+ |> put_req_header("accept", "application/activity+json")
+ |> get("/objects/#{uuid}")
assert json_response(conn, 200) == ObjectView.render("object.json", %{object: note})
end
@@ -34,12 +36,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
describe "/users/:nickname/inbox" do
test "it inserts an incoming activity into the database", %{conn: conn} do
- data = File.read!("test/fixtures/mastodon-post-activity.json") |> Poison.decode!
+ data = File.read!("test/fixtures/mastodon-post-activity.json") |> Poison.decode!()
- conn = conn
- |> assign(:valid_signature, true)
- |> put_req_header("content-type", "application/activity+json")
- |> post("/inbox", data)
+ conn =
+ conn
+ |> assign(:valid_signature, true)
+ |> put_req_header("content-type", "application/activity+json")
+ |> post("/inbox", data)
assert "ok" == json_response(conn, 200)
:timer.sleep(500)