UNPKG

cs-mpx-dataservice

Version:

MPX Dataservices

34 lines (27 loc) 1.33 kB
/** * Created by paul.rangel on 4/29/15. */ require("chai"); var should = require("should"); var resolveRegistryDomainUrl = require("../lib/resolveRegistryDomainUrl"); describe("resolveRegistryDomainUrl():", function() { var account = "http://stg-admin.access.auth.theplatform.com/data/Account/1431398461"; var accessServiceUrl = "http://www.access.service.com/"; var defaultUrl ='http://access.auth.theplatform.com'; it("Should use the accessServiceUrl as an override", function() { var url = resolveRegistryDomainUrl(accessServiceUrl, account); url.should.startWith(accessServiceUrl); }); it("Should use the account as the rootUrl if accessServiceUrl is not provided", function() { var url = resolveRegistryDomainUrl(undefined, account); url.should.startWith("http://stg-admin.access.auth.theplatform.com/"); }); it("Should use the baseUrl as the rootUrl if accessServiceUrl and account is not provided", function() { var url = resolveRegistryDomainUrl(undefined, undefined); url.should.startWith(defaultUrl); }); it("Should end with registry url \'web/Registry/resolveDomain\'", function() { var url = resolveRegistryDomainUrl(accessServiceUrl, account); url.should.endWith('web/Registry/resolveDomain'); }); });