FIX: I18n Fallbacks were not applying correctly

This commit is contained in:
Robin Ward
2015-12-23 12:09:18 -05:00
parent 47410f1b99
commit d1ebb9d0b5
5 changed files with 42 additions and 28 deletions

View File

@ -118,18 +118,18 @@ describe I18n::Backend::DiscourseI18n do
describe "client json" do
it "is empty by default" do
expect(I18n.client_overrides_json).to eq("{}")
expect(I18n.client_overrides_json('en')).to eq("{}")
end
it "doesn't return server overrides" do
TranslationOverride.upsert!('en', 'foo', 'bar')
expect(I18n.client_overrides_json).to eq("{}")
expect(I18n.client_overrides_json('en')).to eq("{}")
end
it "returns client overrides" do
TranslationOverride.upsert!('en', 'js.foo', 'bar')
TranslationOverride.upsert!('en', 'admin_js.beep', 'boop')
json = ::JSON.parse(I18n.client_overrides_json)
json = ::JSON.parse(I18n.client_overrides_json('en'))
expect(json).to be_present
expect(json['js.foo']).to eq('bar')