[#483] Refactored blocks and follows import, added tests.
This commit is contained in:
parent
700661b761
commit
67b4297f4d
4 changed files with 112 additions and 36 deletions
35
test/web/twitter_api/util_controller_test.exs
Normal file
35
test/web/twitter_api/util_controller_test.exs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
|
||||
use Pleroma.Web.ConnCase
|
||||
|
||||
import Pleroma.Factory
|
||||
|
||||
describe "POST /api/pleroma/follow_import" do
|
||||
test "it returns HTTP 200", %{conn: conn} do
|
||||
user1 = insert(:user)
|
||||
user2 = insert(:user)
|
||||
|
||||
response =
|
||||
conn
|
||||
|> assign(:user, user1)
|
||||
|> post("/api/pleroma/follow_import", %{"list" => "#{user2.ap_id}"})
|
||||
|> json_response(:ok)
|
||||
|
||||
assert response == "job started"
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST /api/pleroma/blocks_import" do
|
||||
test "it returns HTTP 200", %{conn: conn} do
|
||||
user1 = insert(:user)
|
||||
user2 = insert(:user)
|
||||
|
||||
response =
|
||||
conn
|
||||
|> assign(:user, user1)
|
||||
|> post("/api/pleroma/blocks_import", %{"list" => "#{user2.ap_id}"})
|
||||
|> json_response(:ok)
|
||||
|
||||
assert response == "job started"
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue