Merge pull request #6875 from hritvi/old_storage_name
https://github.com/mozilla/fxa-content-server/pull/6875 r=philbooth
This commit is contained in:
Коммит
d28a13fd3d
|
@ -52,13 +52,7 @@ define(function (require, exports, module) {
|
|||
|
||||
var uniqueUserId = this.get('uniqueUserId');
|
||||
if (! uniqueUserId) {
|
||||
if (storage.get('uuid')) {
|
||||
// stomlinson on 2015-07-08:
|
||||
// `uuid` is the old name, this is transition code
|
||||
// and can hopefully be removed after a time.
|
||||
uniqueUserId = storage.get('uuid');
|
||||
storage.remove('uuid');
|
||||
} else if (storage.get('uniqueUserId')) {
|
||||
if (storage.get('uniqueUserId')) {
|
||||
// uniqueUserId is the new name.
|
||||
uniqueUserId = storage.get('uniqueUserId');
|
||||
} else {
|
||||
|
|
|
@ -75,15 +75,16 @@ define(function (require, exports, module) {
|
|||
assert.equal(uniqueUserId.get('uniqueUserId'), 'stored in uniqueUserId');
|
||||
});
|
||||
|
||||
it('migrates data stored in `localStorage.uuid` to `localStorage.uniqueUserId`', function () {
|
||||
it('does not migrates data stored in `localStorage.uuid` to `localStorage.uniqueUserId`', function () {
|
||||
var storage = Storage.factory('localStorage', windowMock);
|
||||
var uniqueUserId = 'originally stored in uuid';
|
||||
storage.set('uuid', uniqueUserId);
|
||||
|
||||
createUniqueUserId();
|
||||
|
||||
assert.equal(storage.get('uniqueUserId'), uniqueUserId);
|
||||
assert.isUndefined(storage.get('uuid'));
|
||||
assert.equal(storage.get('uuid'), uniqueUserId);
|
||||
assert.notEqual(storage.get('uuid'), storage.get('uniqueUserId'));
|
||||
assert.ok(storage.get('uniqueUserId'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче