From db223b2a3fb6856c4a884c2a91a3bd8af87ff425 Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sun, 6 Nov 2011 12:52:01 -0800 Subject: [PATCH] Rename and make pending the spec for populating the cache --- spec/models/user/querying_spec.rb | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/spec/models/user/querying_spec.rb b/spec/models/user/querying_spec.rb index 94f60bcb1..d010570d3 100644 --- a/spec/models/user/querying_spec.rb +++ b/spec/models/user/querying_spec.rb @@ -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 => [])