Commit 200ab27e authored by kaniini's avatar kaniini Committed by kaniini
Browse files

test: add test proving that users are refreshed when stale

parent c9f6eb9a
......@@ -166,6 +166,25 @@ test "returns nil for nonexistant local user" do
fetched_user = User.get_or_fetch_by_nickname("nonexistant")
assert fetched_user == nil
test "updates an existing user, if stale" do
a_week_ago = NaiveDateTime.add(NaiveDateTime.utc_now(), -604_800)
orig_user =
local: false,
nickname: "",
ap_id: "",
last_refreshed_at: a_week_ago
assert orig_user.last_refreshed_at == a_week_ago
user = User.get_or_fetch_by_ap_id("")
refute user.last_refreshed_at == orig_user.last_refreshed_at
test "returns an ap_id for a user" do
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment