|
|
@@ -32,6 +32,20 @@ defmodule Pleroma.Web.MastodonAPI.DomainBlockControllerTest do |
|
|
|
refute User.blocks?(user, other_user) |
|
|
|
end |
|
|
|
|
|
|
|
test "blocking a domain via query params" do |
|
|
|
%{user: user, conn: conn} = oauth_access(["write:blocks"]) |
|
|
|
other_user = insert(:user, %{ap_id: "https://dogwhistle.zone/@pundit"}) |
|
|
|
|
|
|
|
ret_conn = |
|
|
|
conn |
|
|
|
|> put_req_header("content-type", "application/json") |
|
|
|
|> post("/api/v1/domain_blocks?domain=dogwhistle.zone") |
|
|
|
|
|
|
|
assert %{} == json_response_and_validate_schema(ret_conn, 200) |
|
|
|
user = User.get_cached_by_ap_id(user.ap_id) |
|
|
|
assert User.blocks?(user, other_user) |
|
|
|
end |
|
|
|
|
|
|
|
test "unblocking a domain via query params" do |
|
|
|
%{user: user, conn: conn} = oauth_access(["write:blocks"]) |
|
|
|
other_user = insert(:user, %{ap_id: "https://dogwhistle.zone/@pundit"}) |
|
|
|