Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into frontend-bundles-downloads
This commit is contained in:
commit
c1d51944c7
335 changed files with 4276 additions and 1776 deletions
|
|
@ -127,4 +127,43 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do
|
|||
assert Enum.empty?(Object.get_by_id(object2.id).data["likes"])
|
||||
end
|
||||
end
|
||||
|
||||
describe "ensure_expiration" do
|
||||
test "it adds to expiration old statuses" do
|
||||
%{id: activity_id1} = insert(:note_activity)
|
||||
|
||||
%{id: activity_id2} =
|
||||
insert(:note_activity, %{inserted_at: NaiveDateTime.from_iso8601!("2015-01-23 23:50:07")})
|
||||
|
||||
%{id: activity_id3} = activity3 = insert(:note_activity)
|
||||
|
||||
expires_at =
|
||||
NaiveDateTime.utc_now()
|
||||
|> NaiveDateTime.add(60 * 61, :second)
|
||||
|> NaiveDateTime.truncate(:second)
|
||||
|
||||
Pleroma.ActivityExpiration.create(activity3, expires_at)
|
||||
|
||||
Mix.Tasks.Pleroma.Database.run(["ensure_expiration"])
|
||||
|
||||
expirations =
|
||||
Pleroma.ActivityExpiration
|
||||
|> order_by(:activity_id)
|
||||
|> Repo.all()
|
||||
|
||||
assert [
|
||||
%Pleroma.ActivityExpiration{
|
||||
activity_id: ^activity_id1
|
||||
},
|
||||
%Pleroma.ActivityExpiration{
|
||||
activity_id: ^activity_id2,
|
||||
scheduled_at: ~N[2016-01-23 23:50:07]
|
||||
},
|
||||
%Pleroma.ActivityExpiration{
|
||||
activity_id: ^activity_id3,
|
||||
scheduled_at: ^expires_at
|
||||
}
|
||||
] = expirations
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ defmodule Mix.Tasks.Pleroma.DigestTest do
|
|||
:ok
|
||||
end
|
||||
|
||||
setup do: clear_config([Pleroma.Emails.Mailer, :enabled], true)
|
||||
|
||||
describe "pleroma.digest test" do
|
||||
test "Sends digest to the given user" do
|
||||
user1 = insert(:user)
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ defmodule Mix.Tasks.Pleroma.EmailTest do
|
|||
:ok
|
||||
end
|
||||
|
||||
setup do: clear_config([Pleroma.Emails.Mailer, :enabled], true)
|
||||
|
||||
describe "pleroma.email test" do
|
||||
test "Sends test email with no given address" do
|
||||
mail_to = Config.get([:instance, :email])
|
||||
|
|
|
|||
|
|
@ -42,7 +42,11 @@ defmodule Mix.Tasks.Pleroma.RelayTest do
|
|||
assert activity.data["object"] == target_user.ap_id
|
||||
|
||||
:ok = Mix.Tasks.Pleroma.Relay.run(["list"])
|
||||
assert_receive {:mix_shell, :info, ["mastodon.example.org (no Accept received)"]}
|
||||
|
||||
assert_receive {:mix_shell, :info,
|
||||
[
|
||||
"http://mastodon.example.org/users/admin - no Accept received (relay didn't follow back)"
|
||||
]}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -95,8 +99,8 @@ defmodule Mix.Tasks.Pleroma.RelayTest do
|
|||
|
||||
:ok = Mix.Tasks.Pleroma.Relay.run(["list"])
|
||||
|
||||
assert_receive {:mix_shell, :info, ["mstdn.io"]}
|
||||
assert_receive {:mix_shell, :info, ["mastodon.example.org"]}
|
||||
assert_receive {:mix_shell, :info, ["https://mstdn.io/users/mayuutann"]}
|
||||
assert_receive {:mix_shell, :info, ["http://mastodon.example.org/users/admin"]}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.ReleaseEnvTest do
|
||||
use ExUnit.Case
|
||||
import ExUnit.CaptureIO, only: [capture_io: 1]
|
||||
|
||||
@path "config/pleroma.test.env"
|
||||
|
||||
def do_clean do
|
||||
if File.exists?(@path) do
|
||||
File.rm_rf(@path)
|
||||
end
|
||||
end
|
||||
|
||||
setup do
|
||||
do_clean()
|
||||
on_exit(fn -> do_clean() end)
|
||||
:ok
|
||||
end
|
||||
|
||||
test "generate pleroma.env" do
|
||||
assert capture_io(fn ->
|
||||
Mix.Tasks.Pleroma.ReleaseEnv.run(["gen", "--path", @path, "--force"])
|
||||
end) =~ "The file generated"
|
||||
|
||||
assert File.read!(@path) =~ "RELEASE_COOKIE="
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue