diff options
author | winh <winnie@gitlab.com> | 2017-05-10 18:11:35 +0200 |
---|---|---|
committer | winh <winnie@gitlab.com> | 2017-05-10 18:11:39 +0200 |
commit | 687bf3a659a29fab329b95c6c736bb717528c49c (patch) | |
tree | 1a45533f23ea46d0b81d0fc4790ec6b0c85f4d8f | |
parent | b3c7958ac6b438a6a7b9adf4e2c3f85f65dc24f9 (diff) | |
download | gitlab-ce-winh-pending-ajax-cache.tar.gz |
Rename AjaxCache.purge to AjaxCache.removewinh-pending-ajax-cache
-rw-r--r-- | app/assets/javascripts/lib/utils/ajax_cache.js | 2 | ||||
-rw-r--r-- | spec/javascripts/lib/utils/ajax_cache_spec.js | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/app/assets/javascripts/lib/utils/ajax_cache.js b/app/assets/javascripts/lib/utils/ajax_cache.js index a4897a16002..cf030d613df 100644 --- a/app/assets/javascripts/lib/utils/ajax_cache.js +++ b/app/assets/javascripts/lib/utils/ajax_cache.js @@ -12,7 +12,7 @@ class AjaxCache { return Object.prototype.hasOwnProperty.call(this.internalStorage, endpoint); } - purge(endpoint) { + remove(endpoint) { delete this.internalStorage[endpoint]; } diff --git a/spec/javascripts/lib/utils/ajax_cache_spec.js b/spec/javascripts/lib/utils/ajax_cache_spec.js index d0aa85f7283..e1747a82329 100644 --- a/spec/javascripts/lib/utils/ajax_cache_spec.js +++ b/spec/javascripts/lib/utils/ajax_cache_spec.js @@ -53,9 +53,9 @@ describe('AjaxCache', () => { }); }); - describe('purge', () => { + describe('remove', () => { it('does nothing if cache is empty', () => { - AjaxCache.purge(dummyEndpoint); + AjaxCache.remove(dummyEndpoint); expect(AjaxCache.internalStorage).toEqual({ }); }); @@ -63,7 +63,7 @@ describe('AjaxCache', () => { it('does nothing if cache contains no matching data', () => { AjaxCache.internalStorage['not matching'] = dummyResponse; - AjaxCache.purge(dummyEndpoint); + AjaxCache.remove(dummyEndpoint); expect(AjaxCache.internalStorage['not matching']).toBe(dummyResponse); }); @@ -71,7 +71,7 @@ describe('AjaxCache', () => { it('removes matching data', () => { AjaxCache.internalStorage[dummyEndpoint] = dummyResponse; - AjaxCache.purge(dummyEndpoint); + AjaxCache.remove(dummyEndpoint); expect(AjaxCache.internalStorage).toEqual({ }); }); |