diff options
author | Stan Hu <stanhu@gmail.com> | 2016-10-23 20:31:18 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-10-23 20:31:18 +0300 |
commit | 4ea1973f5971f9c72230779d28f228b5da1148af (patch) | |
tree | 85899024d97b0d5bc648e265684ec94e2d105d66 /spec/models/repository_spec.rb | |
parent | a98ad03ba18da0b1534f36dafafa9a1c644d0bf1 (diff) |
Expire and build repository cache after project import
After a project import, there's a chance that the UI checks the
branch count before the project has been imported. This change
causes more of the keys to be flushed after an import and forces
a rebuild of the repository cache.
Closes #13518
Diffstat (limited to 'spec/models/repository_spec.rb')
-rw-r--r-- | spec/models/repository_spec.rb | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index f977cf73673..187a1bf2d79 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -1146,28 +1146,17 @@ describe Repository, models: true do end describe '#before_import' do - it 'flushes the emptiness cachess' do - expect(repository).to receive(:expire_emptiness_caches) - - repository.before_import - end - - it 'flushes the exists cache' do - expect(repository).to receive(:expire_exists_cache) + it 'flushes the repository caches' do + expect(repository).to receive(:expire_content_cache) repository.before_import end end describe '#after_import' do - it 'flushes the emptiness cachess' do - expect(repository).to receive(:expire_emptiness_caches) - - repository.after_import - end - - it 'flushes the exists cache' do - expect(repository).to receive(:expire_exists_cache) + it 'flushes and builds the cache' do + expect(repository).to receive(:expire_content_cache) + expect(repository).to receive(:build_cache) repository.after_import end |