Merge branch 'develop' into 'develop'
Change follow_operation schema to use type BooleanLike Closes #2999 See merge request pleroma/pleroma!3787
This commit is contained in:
commit
3394394e0f
@ -223,12 +223,12 @@ defmodule Pleroma.Web.ApiSpec.AccountOperation do
|
|||||||
type: :object,
|
type: :object,
|
||||||
properties: %{
|
properties: %{
|
||||||
reblogs: %Schema{
|
reblogs: %Schema{
|
||||||
type: :boolean,
|
allOf: [BooleanLike],
|
||||||
description: "Receive this account's reblogs in home timeline? Defaults to true.",
|
description: "Receive this account's reblogs in home timeline? Defaults to true.",
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
notify: %Schema{
|
notify: %Schema{
|
||||||
type: :boolean,
|
allOf: [BooleanLike],
|
||||||
description:
|
description:
|
||||||
"Receive notifications for all statuses posted by the account? Defaults to false.",
|
"Receive notifications for all statuses posted by the account? Defaults to false.",
|
||||||
default: false
|
default: false
|
||||||
|
@ -896,6 +896,12 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
|||||||
|> post("/api/v1/accounts/#{followed.id}/follow", %{reblogs: true})
|
|> post("/api/v1/accounts/#{followed.id}/follow", %{reblogs: true})
|
||||||
|> json_response_and_validate_schema(200)
|
|> json_response_and_validate_schema(200)
|
||||||
|
|
||||||
|
assert %{"showing_reblogs" => true} =
|
||||||
|
conn
|
||||||
|
|> put_req_header("content-type", "application/json")
|
||||||
|
|> post("/api/v1/accounts/#{followed.id}/follow", %{reblogs: "1"})
|
||||||
|
|> json_response_and_validate_schema(200)
|
||||||
|
|
||||||
assert [%{"id" => ^reblog_id}] =
|
assert [%{"id" => ^reblog_id}] =
|
||||||
conn
|
conn
|
||||||
|> get("/api/v1/timelines/home")
|
|> get("/api/v1/timelines/home")
|
||||||
@ -925,6 +931,12 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
|||||||
|> post("/api/v1/accounts/#{followed.id}/follow", %{reblogs: false})
|
|> post("/api/v1/accounts/#{followed.id}/follow", %{reblogs: false})
|
||||||
|> json_response_and_validate_schema(200)
|
|> json_response_and_validate_schema(200)
|
||||||
|
|
||||||
|
assert %{"showing_reblogs" => false} =
|
||||||
|
conn
|
||||||
|
|> put_req_header("content-type", "application/json")
|
||||||
|
|> post("/api/v1/accounts/#{followed.id}/follow", %{reblogs: "0"})
|
||||||
|
|> json_response_and_validate_schema(200)
|
||||||
|
|
||||||
assert [] ==
|
assert [] ==
|
||||||
conn
|
conn
|
||||||
|> get("/api/v1/timelines/home")
|
|> get("/api/v1/timelines/home")
|
||||||
@ -935,21 +947,23 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
|||||||
%{conn: conn} = oauth_access(["follow"])
|
%{conn: conn} = oauth_access(["follow"])
|
||||||
followed = insert(:user)
|
followed = insert(:user)
|
||||||
|
|
||||||
ret_conn =
|
assert %{"subscribing" => true} =
|
||||||
conn
|
conn
|
||||||
|> put_req_header("content-type", "application/json")
|
|> put_req_header("content-type", "application/json")
|
||||||
|> post("/api/v1/accounts/#{followed.id}/follow", %{notify: true})
|
|> post("/api/v1/accounts/#{followed.id}/follow", %{notify: true})
|
||||||
|
|> json_response_and_validate_schema(200)
|
||||||
|
|
||||||
assert %{"id" => _id, "subscribing" => true} =
|
assert %{"subscribing" => true} =
|
||||||
json_response_and_validate_schema(ret_conn, 200)
|
conn
|
||||||
|
|> put_req_header("content-type", "application/json")
|
||||||
|
|> post("/api/v1/accounts/#{followed.id}/follow", %{notify: "1"})
|
||||||
|
|> json_response_and_validate_schema(200)
|
||||||
|
|
||||||
ret_conn =
|
assert %{"subscribing" => false} =
|
||||||
conn
|
conn
|
||||||
|> put_req_header("content-type", "application/json")
|
|> put_req_header("content-type", "application/json")
|
||||||
|> post("/api/v1/accounts/#{followed.id}/follow", %{notify: false})
|
|> post("/api/v1/accounts/#{followed.id}/follow", %{notify: false})
|
||||||
|
|> json_response_and_validate_schema(200)
|
||||||
assert %{"id" => _id, "subscribing" => false} =
|
|
||||||
json_response_and_validate_schema(ret_conn, 200)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "following / unfollowing errors", %{user: user, conn: conn} do
|
test "following / unfollowing errors", %{user: user, conn: conn} do
|
||||||
|
Loading…
Reference in New Issue
Block a user