aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/mastodon-auth-tests.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/mastodon-auth-tests.el b/test/mastodon-auth-tests.el
new file mode 100644
index 0000000..0963e95
--- /dev/null
+++ b/test/mastodon-auth-tests.el
@@ -0,0 +1,12 @@
+(require 'el-mock)
+(load-file "../lisp/mastodon-auth.el")
+
+(ert-deftest mastodon-auth:registration-success ()
+ (let ((hash (make-hash-table :test 'equal))
+ (client-plist '(:client_id "client-id" :client_secret "client-secret")))
+ (puthash "client_id" "client-id" hash)
+ (puthash "client_secret" "client-secret" hash)
+ (with-mock
+ (stub mastodon--json-hash-table => hash)
+ (mastodon-auth--registration-success)
+ (should (equal client-plist mastodon--client-app-plist)))))