aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2021-12-20 21:24:02 +0100
committermousebot <mousebot@riseup.net>2021-12-20 21:24:02 +0100
commit7e3269835aace403d6462655dfa79d9a3060b02a (patch)
tree32c8f4b8c5495222ee3d7133b3e9467fa79c682d
parentcb920113ac0cd7b8b57b7936432e7d0805401441 (diff)
improve delete toot tests
-rw-r--r--lisp/mastodon-tl.el2
-rw-r--r--test/mastodon-tl-tests.el2
-rw-r--r--test/mastodon-toot-tests.el14
3 files changed, 11 insertions, 7 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index e3cd5c7..61b2885 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1117,6 +1117,8 @@ by `mastodon-tl--follow-user' to enable or disable notifications."
((string-equal notify "false")
(message "Not receiving notifications for user %s (@%s)!"
name user-handle))
+ ((string-equal action "mute")
+ (message "User %s (@%s) %sd!" name user-handle action))
((eq notify nil)
(message "User %s (@%s) %sed!" name user-handle action)))))))
diff --git a/test/mastodon-tl-tests.el b/test/mastodon-tl-tests.el
index c36b95a..dd07416 100644
--- a/test/mastodon-tl-tests.el
+++ b/test/mastodon-tl-tests.el
@@ -1069,7 +1069,7 @@ correct value for following, as well as notifications enabled or disabled."
(mastodon-tl--do-user-action-function url-block
user-name
user-handle
- "blocked")
+ "block")
"User some-user (@some-user@instance.url) blocked!")))
(with-mock
(mock (mastodon-http--post url-true nil nil) => response-buffer-true)
diff --git a/test/mastodon-toot-tests.el b/test/mastodon-toot-tests.el
index 1ad2558..f2c7b8f 100644
--- a/test/mastodon-toot-tests.el
+++ b/test/mastodon-toot-tests.el
@@ -99,14 +99,16 @@ mention string."
(ert-deftest mastodon-toot--delete-toot-fail ()
"Should refuse to delete toot."
- (with-temp-buffer
- (insert mastodon-toot--mock-toot)
- (goto-char (point-min))
- (should (equal (mastodon-toot--delete-toot)
- "You can only delete (and redraft) your own toots."))))
+ (let ((toot mastodon-toot-test-base-toot))
+ (with-mock
+ (mock (mastodon-auth--user-acct) => "joebogus")
+ ;; (mock (mastodon-toot--own-toot-p toot) => nil)
+ (mock (mastodon-tl--property 'toot-json) => mastodon-toot-test-base-toot)
+ (should (equal (mastodon-toot--delete-toot)
+ "You can only delete (and redraft) your own toots.")))))
(ert-deftest mastodon-toot--delete-toot ()
- "Should return correct triaged response to a DELETE request."
+ "Should return correct triaged response to a legitimate DELETE request."
(with-temp-buffer
(insert mastodon-toot--200-html)
(let ((delete-response (current-buffer))