o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1357330528.488579: @value"k{I" class:EFI"ProcessedAsset;FI"logical_path;FI"temporal_spec.js;FI" pathname;FI"M/Users/jejacks0n/Projects/temporal/spec/javascripts/temporal_spec.coffee;FI"content_type;FI"application/javascript;FI" mtime;FI"2013-01-04T13:15:23-07:00;FI" length;FiVI" digest;F"%bba733a9ec9b07bddca4ad3c287b9571I" source;FI"V(function() { describe("Temporal", function() { beforeEach(function() { document.cookie = 'timezone='; document.cookie = 'timezone_offset='; return this.timezoneStub = { name: 'foo', offset: 0 }; }); describe("signature", function() { return it("has a detect and reference method", function() { expect(Object.keys(Temporal).length).toBe(2); expect(Object.keys(Temporal)).toEqual(['detect', 'reference']); expect(typeof Temporal.detect).toBe('function'); return expect(typeof Temporal.reference).toBe('function'); }); }); describe(".detect", function() { beforeEach(function() { if (Temporal.reference) { window.Temporal = Temporal.reference(); } this.spy = spyOn(Temporal.prototype, 'detectLocally').andReturn(this.timezoneStub); return this.callback = function() {}; }); return it("instantiates an instance and passes arguments", function() { var instance; instance = Temporal.detect('username', this.callback); expect(this.spy).toHaveBeenCalled(); expect(instance.username).toBe('username'); return expect(instance.callback).toBe(this.callback); }); }); describe("constructor", function() { it("calls #detectLocally", function() { var spy; spy = spyOn(Temporal.prototype, 'detectLocally').andReturn(this.timezoneStub); new Temporal(); return expect(spy.callCount).toBe(1); }); it("calls #geoLocate if there's a username for the GeoName API", function() { var spy; spyOn(Temporal.prototype, 'detectLocally').andReturn({ name: 'foo', offset: 1 }); spy = spyOn(Temporal.prototype, 'geoLocate'); new Temporal('username'); if (navigator.geolocation) { return expect(spy.callCount).toBe(1); } }); it("doesn't call #geoLocate if there isn't a username", function() { var spy; spyOn(Temporal.prototype, 'detectLocally').andReturn({ name: 'foo', offset: 1 }); spy = spyOn(Temporal.prototype, 'geoLocate'); new Temporal(); return expect(spy.callCount).toBe(0); }); return it("calls #set", function() { var spy; spyOn(Temporal.prototype, 'detectLocally').andReturn(this.timezoneStub); spy = spyOn(Temporal.prototype, 'set'); new Temporal(); expect(spy.callCount).toBe(1); return expect(spy).toHaveBeenCalledWith({ name: 'foo', offset: 0 }); }); }); return describe("#detectLocally", function() { beforeEach(function() { spyOn(Temporal.prototype, 'detect'); return this.temporal = new Temporal(); }); it("returns a quickly determined time zone", function() { var timezone; spyOn(Temporal.prototype, 'januaryOffset').andReturn(-420); spyOn(Temporal.prototype, 'juneOffset').andReturn(-360); timezone = this.temporal.detectLocally(); return expect(timezone).toEqual({ name: 'America/Denver', offset: -7 }); }); return it("handles other locations than denver", function() { var timezone; spyOn(Temporal.prototype, 'januaryOffset').andReturn(120); spyOn(Temporal.prototype, 'juneOffset').andReturn(120); timezone = this.temporal.detectLocally(); return expect(timezone).toEqual({ name: 'Africa/Johannesburg', offset: 2 }); }); }); }); }).call(this); ;TI"dependency_digest;F"%6fe732f9d3edd8de808fd7baa7174b3cI"required_paths;F[I"T/Users/jejacks0n/Projects/temporal/vendor/assets/javascripts/temporal.js.coffee;FI"M/Users/jejacks0n/Projects/temporal/spec/javascripts/temporal_spec.coffee;FI"dependency_paths;F[{I" path;FI"M/Users/jejacks0n/Projects/temporal/spec/javascripts/temporal_spec.coffee;FI" mtime;FI"2013-01-04T13:15:23-07:00;FI" digest;F"%a5e838494c0b9f3940366c0e4225da91{I" path;FI"T/Users/jejacks0n/Projects/temporal/vendor/assets/javascripts/temporal.js.coffee;FI" mtime;FI"2012-09-13T23:40:27-06:00;FI" digest;F"%0d09fc8c3b1560e8586e659e783fa062I" _version;F"%9f3b95dd7ea3030dc35985c0a8020862