feat: expiry for cache keys [CW-3038] (#8793)
* feat: set cache keys for 3 days only * feat: invalidate should set the latest timestamp * refactor: cache_keys concern * remove invalidate_cache method * refactor reset to set to new value instead of delete * ensure only one event is dispatched * feat: set expiry to 24 hours * chore: make expiry 48 hours * feat: include destroy event * feat: set expiry to 72 days * fix: typo * test: cache update after `touch` * test: update cache keys * refactor: remove after_touch, it's already handled in commit
This commit is contained in:
@@ -250,5 +250,15 @@ RSpec.describe Inbox do
|
||||
cache_keys: inbox.account.cache_keys
|
||||
)
|
||||
end
|
||||
|
||||
it 'updates the cache key after update' do
|
||||
expect(inbox.account).to receive(:update_cache_key).with('inbox')
|
||||
inbox.update(name: 'New Name')
|
||||
end
|
||||
|
||||
it 'updates the cache key after touch' do
|
||||
expect(inbox.account).to receive(:update_cache_key).with('inbox')
|
||||
inbox.touch # rubocop:disable Rails/SkipsModelValidations
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user