Sha256: 70559ba95cea00cbb9f69f5d366a7548e120e69cea0b702c75213c377e96f2a8
Contents?: true
Size: 1.16 KB
Versions: 61
Compression:
Stored size: 1.16 KB
Contents
var I18n = require("../../app/assets/javascripts/i18n"); describe("Prepare options", function(){ beforeEach(function(){ I18n.reset(); }); it("merges two objects", function(){ var options = I18n.prepareOptions( {name: "Mary Doe"}, {name: "John Doe", role: "user"} ); expect(options.name).toEqual("Mary Doe"); expect(options.role).toEqual("user"); }); it("merges multiple objects", function(){ var options = I18n.prepareOptions( {name: "Mary Doe"}, {name: "John Doe", role: "user"}, {age: 33}, {email: "mary@doe.com", url: "http://marydoe.com"}, {role: "admin", email: "john@doe.com"} ); expect(options.name).toEqual("Mary Doe"); expect(options.role).toEqual("user"); expect(options.age).toEqual(33); expect(options.email).toEqual("mary@doe.com"); expect(options.url).toEqual("http://marydoe.com"); }); it("returns an empty object when values are null", function(){ expect(I18n.prepareOptions(null, null)).toEqual({}); }); it("returns an empty object when values are undefined", function(){ expect(I18n.prepareOptions(undefined, undefined)).toEqual({}); }); });
Version data entries
61 entries across 61 versions & 3 rubygems