aboutsummaryrefslogtreecommitdiff
path: root/test/mastodon-toot-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/mastodon-toot-tests.el')
-rw-r--r--test/mastodon-toot-tests.el14
1 files changed, 8 insertions, 6 deletions
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))