fix test
This commit is contained in:
parent
cf53e300f8
commit
2030ffd490
3 changed files with 22 additions and 3 deletions
|
|
@ -5,6 +5,8 @@
|
|||
defmodule Mix.Tasks.Pleroma.InstanceTest do
|
||||
use ExUnit.Case
|
||||
|
||||
@release_env_file "./test/pleroma.test.env"
|
||||
|
||||
setup do
|
||||
File.mkdir_p!(tmp_path())
|
||||
|
||||
|
|
@ -16,6 +18,8 @@ defmodule Mix.Tasks.Pleroma.InstanceTest do
|
|||
File.rm_rf(Path.join(static_dir, "robots.txt"))
|
||||
end
|
||||
|
||||
if File.exists?(@release_env_file), do: File.rm_rf(@release_env_file)
|
||||
|
||||
Pleroma.Config.put([:instance, :static_dir], static_dir)
|
||||
end)
|
||||
|
||||
|
|
@ -69,7 +73,9 @@ defmodule Mix.Tasks.Pleroma.InstanceTest do
|
|||
"--dedupe-uploads",
|
||||
"n",
|
||||
"--anonymize-uploads",
|
||||
"n"
|
||||
"n",
|
||||
"--release-env-file",
|
||||
@release_env_file
|
||||
])
|
||||
end
|
||||
|
||||
|
|
@ -91,6 +97,9 @@ defmodule Mix.Tasks.Pleroma.InstanceTest do
|
|||
assert generated_config =~ "filters: [Pleroma.Upload.Filter.ExifTool]"
|
||||
assert File.read!(tmp_path() <> "setup.psql") == generated_setup_psql()
|
||||
assert File.exists?(Path.expand("./test/instance/static/robots.txt"))
|
||||
assert File.exists?(@release_env_file)
|
||||
|
||||
assert File.read!(@release_env_file) =~ ~r/^RELEASE_COOKIE=.*/
|
||||
end
|
||||
|
||||
defp generated_setup_psql do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue