aboutsummaryrefslogtreecommitdiff
path: root/test/signature_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/signature_test.exs')
-rw-r--r--test/signature_test.exs14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/signature_test.exs b/test/signature_test.exs
index 26337eaf9..d5bf63d7d 100644
--- a/test/signature_test.exs
+++ b/test/signature_test.exs
@@ -8,6 +8,7 @@ defmodule Pleroma.SignatureTest do
import ExUnit.CaptureLog
import Pleroma.Factory
import Tesla.Mock
+ import Mock
alias Pleroma.Signature
@@ -114,4 +115,17 @@ defmodule Pleroma.SignatureTest do
"https://example.com/users/1234"
end
end
+
+ describe "signed_date" do
+ test "it returns formatted current date" do
+ with_mock(NaiveDateTime, utc_now: fn -> ~N[2019-08-23 18:11:24.822233] end) do
+ assert Signature.signed_date() == "Fri, 23 Aug 2019 18:11:24 GMT"
+ end
+ end
+
+ test "it returns formatted date" do
+ assert Signature.signed_date(~N[2019-08-23 08:11:24.822233]) ==
+ "Fri, 23 Aug 2019 08:11:24 GMT"
+ end
+ end
end