Sha256: 6a4ee660d04dbb84b98c55fb674d22fa75698d843833b47696a399ebedee33fb
Contents?: true
Size: 1.33 KB
Versions: 24
Compression:
Stored size: 1.33 KB
Contents
var BastionConfig, PrefixInterceptor; describe('PrefixInterceptor', function() { beforeEach(module('gettext')); beforeEach(module('Bastion')); beforeEach(inject(function(_PrefixInterceptor_, _BastionConfig_) { PrefixInterceptor = _PrefixInterceptor_; BastionConfig = _BastionConfig_; })); describe('uncached template URL and no relativeUrlRoot', function() { it('prepends / to config.url', function() { var result = PrefixInterceptor.request({ url: 'template.html'}); expect(result.url).toBe('/template.html'); }); }); describe('relativeUrlRoot configured', function() { beforeEach(function() { BastionConfig.relativeUrlRoot = '/foreman/'; }); describe('uncached template URL', function() { it('prepends the relative URL prefix', function() { var result = PrefixInterceptor.request({ url: 'template.html'}); expect(result.url).toBe('/foreman/template.html'); }); }); describe('non-template URL', function() { it('prepends the relative URL prefix', function() { var result = PrefixInterceptor.request({ url: 'api/v2/hosts'}); expect(result.url).toBe('/foreman/api/v2/hosts'); }); }); }); });
Version data entries
24 entries across 24 versions & 1 rubygems