Rename and make pending the spec for populating the cache
This commit is contained in:
parent
7200b0d9b3
commit
db223b2a3f
1 changed files with 2 additions and 13 deletions
|
|
@ -98,26 +98,15 @@ describe User do
|
||||||
AppConfig[:redis_cache] = nil
|
AppConfig[:redis_cache] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
it "gets populated with latest 100 posts" do
|
it "kicks off a job that will populate the latest 100 posts" do
|
||||||
cache = mock(:cache_exists? => true, :supported_order? => true, :size => 0, :ensure_populated! => mock, :post_ids => [])
|
pending "we need a job for this - ensure_populated! is too costly to do synchronously for new users"
|
||||||
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)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not get used if if all_aspects? option is not present' do
|
it 'does not get used if if all_aspects? option is not present' do
|
||||||
RedisCache.should_not_receive(:new)
|
RedisCache.should_not_receive(:new)
|
||||||
|
|
||||||
alice.visible_shareable_ids(Post, @opts.merge({:all_aspects? => false}))
|
alice.visible_shareable_ids(Post, @opts.merge({:all_aspects? => false}))
|
||||||
end
|
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
|
describe '#use_cache?' do
|
||||||
before do
|
before do
|
||||||
cache = mock(:cache_exists? => true, :supported_order? => true, :ensure_populated! => mock, :post_ids => [])
|
cache = mock(:cache_exists? => true, :supported_order? => true, :ensure_populated! => mock, :post_ids => [])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue