aboutsummaryrefslogtreecommitdiff
path: root/test/tasks
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2020-07-29 13:01:16 -0500
committerAlex Gleason <alex@alexgleason.me>2020-07-29 13:01:16 -0500
commit702f0fb822d40f0e004df1cdf3d9c2079ddc98e5 (patch)
tree0dd822004be00402b84a9537506b9de3fd0bf5b6 /test/tasks
parent93638935d783c092dabac51982426ebd98a21e0e (diff)
parenta6d3bb5f30697cafc5dd9acf490bde7e2f33f5f8 (diff)
downloadpleroma-702f0fb822d40f0e004df1cdf3d9c2079ddc98e5.tar.gz
Merge remote-tracking branch 'upstream/develop' into mrf-silence
Diffstat (limited to 'test/tasks')
-rw-r--r--test/tasks/release_env_test.exs30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/tasks/release_env_test.exs b/test/tasks/release_env_test.exs
new file mode 100644
index 000000000..519f1eba9
--- /dev/null
+++ b/test/tasks/release_env_test.exs
@@ -0,0 +1,30 @@
+# 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