aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhiseck Paira <abhiseckpaira@disroot.org>2022-02-25 20:42:48 +0530
committerAbhiseck Paira <abhiseckpaira@disroot.org>2022-02-25 20:42:48 +0530
commit92f898f0a90760078a1bbfc843568e858891b6c9 (patch)
treebfa08c83c6578cb5a11f65028d46bdda4737ecb7
parentfbb34e106b7164a9c1d47cf31d9803827540e228 (diff)
test: add `mastodon-auth--user-unaware'
Test for the situation when old mastodon.el users are unaware of the variable `mastodon-active-user'.
-rw-r--r--test/mastodon-auth-tests.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/mastodon-auth-tests.el b/test/mastodon-auth-tests.el
index 3bf65b2..3ecac30 100644
--- a/test/mastodon-auth-tests.el
+++ b/test/mastodon-auth-tests.el
@@ -64,3 +64,11 @@
(should
(equal mastodon-auth--token-alist
'(("https://instance.url" . "foobaz")))))))
+
+(ert-deftest mastodon-auth--user-unaware ()
+ (let ((mastodon-instance-url "https://instance.url")
+ (mastodon-active-user nil)
+ (mastodon-auth--token-alist nil))
+ (with-mock
+ (mock (mastodon-client--active-user))
+ (should-error (mastodon-auth--access-token)))))