Sha256: 53d62dca41b1f019cbe9758f80f23bb97d836ad4cfe26a8de05703e87a7d23c5
Contents?: true
Size: 1.26 KB
Versions: 41
Compression:
Stored size: 1.26 KB
Contents
(function () { 'use strict'; describe('WORKAREA.trafficReferrer', function () { describe('setCookie', function () { beforeEach(function () { WORKAREA.cookie.destroy('workarea_referrer'); }); it('sets a cookie', function () { WORKAREA.trafficReferrer.setReferrer('http://workarea.com'); WORKAREA.trafficReferrer.setCookie(); expect(WORKAREA.cookie.read('workarea_referrer')).to.equal('http://workarea.com'); }); it('does not set a cookie when host matches referrer', function () { WORKAREA.trafficReferrer.setReferrer(window.location.origin); WORKAREA.trafficReferrer.setCookie(); expect(WORKAREA.cookie.read('workarea_referrer')).to.equal(null); }); it('does not set cookie when cookie is already set', function () { WORKAREA.cookie.create('workarea_referrer', 'http://example.com'); WORKAREA.trafficReferrer.setReferrer('http://workarea.com'); WORKAREA.trafficReferrer.setCookie(); expect(WORKAREA.cookie.read('workarea_referrer')).to.equal('http://example.com'); }); }); }); }());
Version data entries
41 entries across 41 versions & 1 rubygems