mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-19 08:06:47 +00:00
Add test for following with subscription
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
64a4c147b1
commit
3892bd353b
|
@ -922,6 +922,27 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
|||
|> json_response_and_validate_schema(200)
|
||||
end
|
||||
|
||||
test "following with subscription and unsubscribing when notify is nil" do
|
||||
%{conn: conn} = oauth_access(["follow"])
|
||||
followed = insert(:user)
|
||||
|
||||
ret_conn =
|
||||
conn
|
||||
|> put_req_header("content-type", "application/json")
|
||||
|> post("/api/v1/accounts/#{followed.id}/follow", %{notify: true})
|
||||
|
||||
assert %{"id" => _id, "subscribing" => true} =
|
||||
json_response_and_validate_schema(ret_conn, 200)
|
||||
|
||||
ret_conn =
|
||||
conn
|
||||
|> put_req_header("content-type", "application/json")
|
||||
|> post("/api/v1/accounts/#{followed.id}/follow")
|
||||
|
||||
assert %{"id" => _id, "subscribing" => false} =
|
||||
json_response_and_validate_schema(ret_conn, 200)
|
||||
end
|
||||
|
||||
test "following / unfollowing errors", %{user: user, conn: conn} do
|
||||
# self follow
|
||||
conn_res = post(conn, "/api/v1/accounts/#{user.id}/follow")
|
||||
|
|
Loading…
Reference in a new issue