Sha256: ec9ccbce1a873f8dce6a4aa4ba9d7c9676e81a97a2a1716b7fe786cda1dff706
Contents?: true
Size: 1.22 KB
Versions: 16
Compression:
Stored size: 1.22 KB
Contents
describe('Spree.t', function() { support.withTranslations({ simple: "simple", nested: { key: "nested key" }, deeply: { nested: { key: "deeply nested key" } } }) it('can get a simple key', function() { expect(Spree.t('simple')).to.equal('simple'); }); it('can get a nested key', function() { expect(Spree.t('nested.key')).to.equal('nested key'); }); it('can get a nested key using scope', function() { expect(Spree.t('key', {scope: 'nested'})).to.equal('nested key'); }); it('can get a deeply nested key', function() { expect(Spree.t('deeply.nested.key')).to.equal('deeply nested key'); }); it('can get a deeply nested key using scope', function() { expect(Spree.t('nested.key', {scope: 'deeply'})).to.equal('deeply nested key'); expect(Spree.t('key', {scope: 'deeply.nested'})).to.equal('deeply nested key'); }); }); describe('Spree.human_attribute_name', function() { support.withTranslations({ activerecord: { attributes: { "spree/model": { "name": "Name" } } } }); it('can get attribute names', function() { expect(Spree.human_attribute_name('spree/model', "name")).to.equal('Name'); }); });
Version data entries
16 entries across 16 versions & 1 rubygems