Example #1
0
            it('is disabled when mode is none', function (done) {
                var config = {
                    mode: 'none'
                };
                var client = new Cache.Client(Defaults.cache('redis'));
                var cache = new Cache.Policy(config, client);

                expect(cache.isEnabled()).to.equal(false);
                expect(Object.keys(cache.rule.mode).length).to.equal(0);

                done();
            });
Example #2
0
            it('is enabled for both client and server by defaults', function (done) {
                var config = {
                    expiresIn: 50000,
                    segment: 'test'
                };
                var client = new Cache.Client(Defaults.cache('redis'));
                var cache = new Cache.Policy(config, client);

                expect(cache.isMode('server')).to.equal(true);
                expect(cache.isMode('client')).to.equal(true);
                expect(Object.keys(cache.rule.mode).length).to.equal(2);

                done();
            });