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

Version Path
workarea-storefront-3.5.27 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.5.26 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.4.45 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.5.25 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.5.23 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.4.44 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.5.22 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.4.43 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.5.21 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.4.42 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.5.20 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.4.41 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.5.19 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.4.40 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.5.18 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.4.39 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.5.17 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.4.38 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.5.16 test/javascripts/traffic_referrer_spec.js
workarea-storefront-3.4.37 test/javascripts/traffic_referrer_spec.js