Merging develop into feature/770-add-emoji-tags
authorAlex S <alex.strizhakov@gmail.com>
Tue, 2 Apr 2019 13:39:52 +0000 (20:39 +0700)
committerAlex S <alex.strizhakov@gmail.com>
Tue, 2 Apr 2019 13:39:52 +0000 (20:39 +0700)
Conflict test/web/twitter_api/util_controller_test.exs

1  2 
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
lib/pleroma/web/twitter_api/controllers/util_controller.ex
test/web/twitter_api/util_controller_test.exs

index 1063ad28fe0618492b439c52fdadf6e78ace8fc6,e4dd97d46915c738c16c067188cf6a54bf653c69..410f20f8748a653e86172c335ae08d94df22cde8
@@@ -165,24 -170,25 +170,46 @@@ defmodule Pleroma.Web.TwitterAPI.UtilCo
      end
    end
  
 +  describe "/api/pleroma/emoji" do
 +    test "returns json with custom emoji with tags", %{conn: conn} do
 +      [emoji | _body] =
 +        conn
 +        |> get("/api/pleroma/emoji")
 +        |> json_response(200)
 +
 +      [key] = Map.keys(emoji)
 +
 +      %{
 +        ^key => %{
 +          "image_url" => url,
 +          "tags" => tags
 +        }
 +      } = emoji
 +
 +      assert is_binary(url)
 +      assert is_list(tags)
 +    end
 +  end
++
+   describe "GET /ostatus_subscribe?acct=...." do
+     test "adds status to pleroma instance if the `acct` is a status", %{conn: conn} do
+       conn =
+         get(
+           conn,
+           "/ostatus_subscribe?acct=https://mastodon.social/users/emelie/statuses/101849165031453009"
+         )
+       assert redirected_to(conn) =~ "/notice/"
+     end
+     test "show follow account page if the `acct` is a account link", %{conn: conn} do
+       response =
+         get(
+           conn,
+           "/ostatus_subscribe?acct=https://mastodon.social/users/emelie"
+         )
+       assert html_response(response, 200) =~ "Log in to follow"
+     end
+   end
  end