Skip to content
Extraits de code Groupes Projets
Valider db223b2a rédigé par Sarah Mei's avatar Sarah Mei
Parcourir les fichiers

Rename and make pending the spec for populating the cache

parent 7200b0d9
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -98,26 +98,15 @@ describe User do
AppConfig[:redis_cache] = nil
end
it "gets populated with latest 100 posts" do
cache = mock(:cache_exists? => true, :supported_order? => true, :size => 0, :ensure_populated! => mock, :post_ids => [])
RedisCache.stub(:new).and_return(cache)
@opts = alice.send(:prep_opts, Post, @opts)
cache.should_receive(:ensure_populated!).with(hash_including(@opts))
alice.visible_shareable_ids(Post, @opts)
it "kicks off a job that will populate the latest 100 posts" do
pending "we need a job for this - ensure_populated! is too costly to do synchronously for new users"
end
it 'does not get used if if all_aspects? option is not present' do
RedisCache.should_not_receive(:new)
alice.visible_shareable_ids(Post, @opts.merge({:all_aspects? => false}))
end
describe "#ensure_populated_cache" do
it 'does nothing if the cache is already populated'
it 're-populates the cache with the latest posts (in hashes)'
end
describe '#use_cache?' do
before do
cache = mock(:cache_exists? => true, :supported_order? => true, :ensure_populated! => mock, :post_ids => [])
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter