@ -902,6 +902,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 " )
@ -931,6 +937,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 " )
@ -941,21 +953,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