aboutsummaryrefslogtreecommitdiff
path: root/test/mastodon-auth-tests.el
diff options
context:
space:
mode:
authorJohnson Denen <johnson.denen@gmail.com>2018-03-05 22:09:37 -0500
committerGitHub <noreply@github.com>2018-03-05 22:09:37 -0500
commitae8dabda04e377a6ac22cb854e4844f68073f533 (patch)
treeb6c875c5e88e72966440d3641ef37d320ee2d9fd /test/mastodon-auth-tests.el
parente08bb5794762d22f90e85fd65cef7c143e6b9318 (diff)
parente9920d64b5283fca6a34b2144a5a35c4c1d02938 (diff)
Merge pull request #173 from jdenen/develop
Merge 0.7.2 into master
Diffstat (limited to 'test/mastodon-auth-tests.el')
-rw-r--r--test/mastodon-auth-tests.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/mastodon-auth-tests.el b/test/mastodon-auth-tests.el
index 70c63d8..719a56c 100644
--- a/test/mastodon-auth-tests.el
+++ b/test/mastodon-auth-tests.el
@@ -14,7 +14,8 @@
("username" . "foo@bar.com")
("password" . "password")
("scope" . "read write follow"))
- nil))
+ nil
+ :unauthenticated))
(mastodon-auth--generate-token))))
(ert-deftest get-token ()
@@ -26,15 +27,17 @@
(current-buffer)))
(should (equal (mastodon-auth--get-token) '(:access_token "abcdefg"))))))
-(ert-deftest access-token-1 ()
- "Should return `mastodon-auth--token' if non-nil."
- (let ((mastodon-auth--token "foobar"))
+(ert-deftest access-token-found ()
+ "Should return value in `mastodon-auth--token-alist' if found."
+ (let ((mastodon-instance-url "https://instance.url")
+ (mastodon-auth--token-alist '(("https://instance.url" . "foobar")) ))
(should (string= (mastodon-auth--access-token) "foobar"))))
(ert-deftest access-token-2 ()
"Should set and return `mastodon-auth--token' if nil."
- (let ((mastodon-auth--token nil))
+ (let ((mastodon-instance-url "https://instance.url")
+ (mastodon-auth--token nil))
(with-mock
(mock (mastodon-auth--get-token) => '(:access_token "foobaz"))
(should (string= (mastodon-auth--access-token) "foobaz"))
- (should (string= mastodon-auth--token "foobaz")))))
+ (should (equal mastodon-auth--token-alist '(("https://instance.url" . "foobaz")))))))