Sha256: fd57abbbf14b9372fc685b3e62574d6cec8cfc0702d55bb78972a1fd49ff4dce

Contents?: true

Size: 953 Bytes

Versions: 1

Compression:

Stored size: 953 Bytes

Contents

(function() {

  describe("Init", function() {
    it("must load if loaded flag is not set and the browser is not mobile", function() {
      window.overlay_me_loaded = null;
      return expect(OverlayMe.mustLoad()).toBe(true);
    });
    it("must not load if loaded flag is set", function() {
      OverlayMe.setLoaded();
      return expect(OverlayMe.mustLoad()).toBe(false);
    });
    it("must not load if mobile", function() {
      spyOn(OverlayMe, 'userAgent').andReturn('stuff Android stuff');
      return expect(OverlayMe.mustLoad()).toBe(false);
    });
    return it("clearAndReload should delete everything from localStorage and try reload the page", function() {
      localStorage.setItem('test', 'test');
      spyOn(OverlayMe, 'pageReload').andReturn();
      OverlayMe.clearAndReload();
      expect(localStorage.getItem('test')).toBeNull;
      return expect(OverlayMe.pageReload).toHaveBeenCalled();
    });
  });

}).call(this);

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
overlay_me-0.13.4 spec/javascripts/init.spec.js