mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-27 08:16:16 +00:00
added another test
This commit is contained in:
parent
09189c3a7c
commit
4430a0ad12
|
@ -8,18 +8,33 @@ defmodule Pleroma.Web.ThreadMuteTest do
|
||||||
|
|
||||||
import Pleroma.Factory
|
import Pleroma.Factory
|
||||||
|
|
||||||
test "add a mute" do
|
describe "mute tests" do
|
||||||
|
setup do
|
||||||
user = insert(:user, %{id: "1"})
|
user = insert(:user, %{id: "1"})
|
||||||
|
|
||||||
activity =
|
activity =
|
||||||
insert(:note_activity, %{
|
insert(:note_activity, %{
|
||||||
data: %{"context" => "http://localhost:4000/contexts/361ca23e-ffa7-4773-b981-a355a18dc592"}
|
data: %{
|
||||||
|
"context" => "http://localhost:4000/contexts/361ca23e-ffa7-4773-b981-a355a18dc592"
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
[user: user, activity: activity]
|
||||||
|
end
|
||||||
|
|
||||||
|
test "add mute", %{user: user, activity: activity} do
|
||||||
id = activity.id
|
id = activity.id
|
||||||
{:ok, mute} = add_mute(user, id)
|
{:ok, mute} = add_mute(user, id)
|
||||||
|
|
||||||
assert mute.user_id == "1"
|
assert mute.user_id == "1"
|
||||||
assert mute.context == "http://localhost:4000/contexts/361ca23e-ffa7-4773-b981-a355a18dc592"
|
assert mute.context == "http://localhost:4000/contexts/361ca23e-ffa7-4773-b981-a355a18dc592"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "remove mute", %{user: user, activity: activity} do
|
||||||
|
id = activity.id
|
||||||
|
|
||||||
|
add_mute(user, id)
|
||||||
|
{1, nil} = remove_mute(user, id)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue