Converted all resources over to use a newer structure for generating URLs, created unit tests for those, fixed the js build so that the name is still "umbraco" not "umbraco 7" since that causes problems with css and other file references.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
describe('umbRequestHelper tests', function () {
|
||||
var umbRequestHelper;
|
||||
|
||||
beforeEach(module('umbraco.services'));
|
||||
|
||||
beforeEach(inject(function ($injector) {
|
||||
umbRequestHelper = $injector.get('umbRequestHelper');
|
||||
}));
|
||||
|
||||
describe('formatting Urls', function () {
|
||||
|
||||
it('can create a query string from name value pairs', function () {
|
||||
|
||||
expect(umbRequestHelper.dictionaryToQueryString(
|
||||
[{ key1: "value1" }, { key2: "value2" }, { key3: "value3" }])).toBe(
|
||||
"key1=value1&key2=value2&key3=value3");
|
||||
});
|
||||
|
||||
it('can create a url based on server vars', function () {
|
||||
|
||||
expect(umbRequestHelper.getApiUrl("contentTypeApiBaseUrl", "GetAllowedChildren", [{contentId: 123}])).toBe(
|
||||
"/umbraco/Api/ContentType/GetAllowedChildren?contentId=123");
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user