diff options
author | Alexander Griffith <griffitaj@gmail.com> | 2018-02-26 21:05:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-26 21:05:08 -0500 |
commit | f6f6c08976a414762cd512e52237b143dc0e2f30 (patch) | |
tree | 65a51dfd49d08f5f314a0276706fe1dd9f827c2a /test/mastodon-tl-tests.el | |
parent | 285765b9f4f51902d1e00ee9e95af7a52916c959 (diff) | |
parent | 54cc51e72d9bf610b036f2df7eebd79db47e0bc3 (diff) |
Merge pull request #151 from alexjgriffith/fix-numericp
Check if an id is a number before attempting to convert it. Closes #150 in main timelines
Diffstat (limited to 'test/mastodon-tl-tests.el')
-rw-r--r-- | test/mastodon-tl-tests.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/mastodon-tl-tests.el b/test/mastodon-tl-tests.el index 8c7dc4c..7d6a08f 100644 --- a/test/mastodon-tl-tests.el +++ b/test/mastodon-tl-tests.el @@ -104,6 +104,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--relative-time-description () "Should format relative time as expected" (cl-labels ((minutes (n) (* n 60)) |