Merge branch 'develop' into feature/polls-2-electric-boogalo
authorrinpatch <rinpatch@sdf.org>
Mon, 3 Jun 2019 08:14:52 +0000 (11:14 +0300)
committerrinpatch <rinpatch@sdf.org>
Mon, 3 Jun 2019 08:14:52 +0000 (11:14 +0300)
1  2 
lib/pleroma/notification.ex
lib/pleroma/web/activity_pub/transmogrifier.ex
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
lib/pleroma/web/router.ex
test/web/activity_pub/transmogrifier_test.exs
test/web/mastodon_api/mastodon_api_controller_test.exs

Simple merge
Simple merge
index 80832d1d8a93110fa755f12e1fb19d9b8b0e18ae,bcc460f1cd2abe645fa7965806560caec984819f..89c8f79c92644dae846ba8f35dc2ef56a2e36553
@@@ -1259,34 -1210,13 +1259,37 @@@ defmodule Pleroma.Web.ActivityPub.Trans
      end
    end
  
 +  test "Rewrites Answers to Notes" do
 +    user = insert(:user)
 +
 +    {:ok, poll_activity} =
 +      CommonAPI.post(user, %{
 +        "status" => "suya...",
 +        "poll" => %{"options" => ["suya", "suya.", "suya.."], "expires_in" => 10}
 +      })
 +
 +    poll_object = Object.normalize(poll_activity)
 +    # TODO: Replace with CommonAPI vote creation when implemented
 +    data =
 +      File.read!("test/fixtures/mastodon-vote.json")
 +      |> Poison.decode!()
 +      |> Kernel.put_in(["to"], user.ap_id)
 +      |> Kernel.put_in(["object", "inReplyTo"], poll_object.data["id"])
 +      |> Kernel.put_in(["object", "to"], user.ap_id)
 +
 +    {:ok, %Activity{local: false} = activity} = Transmogrifier.handle_incoming(data)
 +    {:ok, data} = Transmogrifier.prepare_outgoing(activity.data)
 +
 +    assert data["object"]["type"] == "Note"
 +  end
 +
    describe "fix_explicit_addressing" do
-     test "moves non-explicitly mentioned actors to cc" do
+     setup do
        user = insert(:user)
+       [user: user]
+     end
  
+     test "moves non-explicitly mentioned actors to cc", %{user: user} do
        explicitly_mentioned_actors = [
          "https://pleroma.gold/users/user1",
          "https://pleroma.gold/user2"