aboutsummaryrefslogtreecommitdiff
path: root/test/mastodon-auth-tests.el
blob: 0963e9573dafa35427b90dde67f5e72ad7de7389 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
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)))))