Fix i18n spec
This commit is contained in:
parent
3bc5b673c6
commit
cd602c19fd
2 changed files with 6 additions and 1 deletions
|
|
@ -77,9 +77,12 @@ Diaspora.I18n = {
|
|||
|
||||
reset: function() {
|
||||
this.locale.data = {};
|
||||
this.locale.fallback.data = {};
|
||||
|
||||
if( arguments.length > 0 && !(_.isEmpty(arguments[0])) )
|
||||
if(arguments.length > 0 && !(_.isEmpty(arguments[0]))) {
|
||||
this.locale.data = arguments[0];
|
||||
this.locale.fallback.data = arguments[0];
|
||||
}
|
||||
}
|
||||
};
|
||||
// @license-end
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ describe("Diaspora.I18n", function() {
|
|||
Diaspora.I18n.load(locale, "en", locale);
|
||||
Diaspora.I18n.reset();
|
||||
expect(Diaspora.I18n.locale.data).toEqual({});
|
||||
expect(Diaspora.I18n.locale.fallback.data).toEqual({});
|
||||
});
|
||||
|
||||
it("sets the locale to only a specific value", function() {
|
||||
|
|
@ -97,6 +98,7 @@ describe("Diaspora.I18n", function() {
|
|||
Diaspora.I18n.load(locale, "en", locale);
|
||||
Diaspora.I18n.reset(data);
|
||||
expect(Diaspora.I18n.locale.data).toEqual(data);
|
||||
expect(Diaspora.I18n.locale.fallback.data).toEqual(data);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue