parent
2020f26040
commit
cf1f35a93a
3 changed files with 44 additions and 10 deletions
|
|
@ -6,7 +6,8 @@ defmodule Pleroma.Web.StreamerTest do
|
|||
use Pleroma.DataCase
|
||||
|
||||
alias Pleroma.Web.Streamer
|
||||
alias Pleroma.{List, User}
|
||||
alias Pleroma.List
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Web.CommonAPI
|
||||
import Pleroma.Factory
|
||||
|
||||
|
|
@ -35,6 +36,28 @@ defmodule Pleroma.Web.StreamerTest do
|
|||
Streamer.push_to_socket(topics, "public", activity)
|
||||
|
||||
Task.await(task)
|
||||
|
||||
task =
|
||||
Task.async(fn ->
|
||||
assert_receive {:text, _}, 4_000
|
||||
end)
|
||||
|
||||
fake_socket = %{
|
||||
transport_pid: task.pid,
|
||||
assigns: %{
|
||||
user: user
|
||||
}
|
||||
}
|
||||
|
||||
{:ok, activity} = CommonAPI.delete(activity.id, other_user)
|
||||
|
||||
topics = %{
|
||||
"public" => [fake_socket]
|
||||
}
|
||||
|
||||
Streamer.push_to_socket(topics, "public", activity)
|
||||
|
||||
Task.await(task)
|
||||
end
|
||||
|
||||
test "it doesn't send to blocked users" do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue