aboutsummaryrefslogtreecommitdiff
path: root/test/mastodon-tl-tests.el
diff options
context:
space:
mode:
authoralexjgriffith <griffitaj@gmail.com>2018-02-25 14:27:47 -0500
committeralexjgriffith <griffitaj@gmail.com>2018-02-25 14:29:02 -0500
commitc268e92f9cf66ab6109d1735beeba92b5d87264c (patch)
treefa7dfd0b6333a266d03acdee10b57b970391b835 /test/mastodon-tl-tests.el
parent3dc3e258b4a4bfee4ff8bfaa91ab1bbc7af29f5f (diff)
Added tests to ensure that ids passed to mastodon-tl--updated-json and mastodon-tl--more-json work as both strings and integers
Diffstat (limited to 'test/mastodon-tl-tests.el')
-rw-r--r--test/mastodon-tl-tests.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/mastodon-tl-tests.el b/test/mastodon-tl-tests.el
index 8c706f5..d22a169 100644
--- a/test/mastodon-tl-tests.el
+++ b/test/mastodon-tl-tests.el
@@ -103,6 +103,26 @@
(mock (mastodon-http--get-json "https://instance.url/api/v1/timelines/foo?max_id=12345"))
(mastodon-tl--more-json "timelines/foo" 12345))))
+(ert-deftest more-json-id-string ()
+ "Should request toots older than max_id.
+
+`mastodon-tl--more-json' should accept and id that is either
+a string or a numeric."
+ (let ((mastodon-instance-url "https://instance.url"))
+ (with-mock
+ (mock (mastodon-http--get-json "https://instance.url/api/v1/timelines/foo?max_id=12345"))
+ (mastodon-tl--more-json "timelines/foo" "12345"))))
+
+(ert-deftest update-json-id-string ()
+ "Should request toots more recent than since_id.
+
+`mastodon-tl--updated-json' should accept and id that is either
+a string or a numeric."
+ (let ((mastodon-instance-url "https://instance.url"))
+ (with-mock
+ (mock (mastodon-http--get-json "https://instance.url/api/v1/timelines/foo?since_id=12345"))
+ (mastodon-tl--updated-json "timelines/foo" "12345"))))
+
(ert-deftest mastodon-tl--byline-regular ()
"Should format the regular toot correctly."
(let ((mastodon-tl--show-avatars-p nil)