0
0
Fork 0

Merge branch 'main' into glitch-soc/merge-upstream

This commit is contained in:
Claire 2022-04-28 18:16:42 +02:00
commit f23f784f18
87 changed files with 911 additions and 678 deletions

View file

@ -65,22 +65,22 @@ describe ApplicationController, type: :controller do
get :show
expect_updated_sign_in_at(user)
expect(Redis.current.get("account:#{user.account_id}:regeneration")).to eq 'true'
expect(redis.get("account:#{user.account_id}:regeneration")).to eq 'true'
expect(RegenerationWorker).to have_received(:perform_async)
end
it 'sets the regeneration marker to expire' do
allow(RegenerationWorker).to receive(:perform_async)
get :show
expect(Redis.current.ttl("account:#{user.account_id}:regeneration")).to be >= 0
expect(redis.ttl("account:#{user.account_id}:regeneration")).to be >= 0
end
it 'regenerates feed when sign in is older than two weeks' do
get :show
expect_updated_sign_in_at(user)
expect(Redis.current.zcard(FeedManager.instance.key(:home, user.account_id))).to eq 3
expect(Redis.current.get("account:#{user.account_id}:regeneration")).to be_nil
expect(redis.zcard(FeedManager.instance.key(:home, user.account_id))).to eq 3
expect(redis.get("account:#{user.account_id}:regeneration")).to be_nil
end
end