Add previous tests

This commit is contained in:
Santi Albo
2013-09-03 23:08:47 +01:00
parent ee99d701b5
commit 59b2a24150
+28
View File
@@ -79,6 +79,34 @@ function test_basic() {
}
function test_config() {
RestangularProvider.setBaseUrl('/api/v1');
RestangularProvider.setExtraFields(['name']);
RestangularProvider.setResponseExtractor(function (response, operation) {
return response.data;
});
RestangularProvider.setDefaultHttpFields({ cache: true });
RestangularProvider.setMethodOverriders(["put", "patch"]);
RestangularProvider.setErrorInterceptor(function (response) {
console.error('' + response.status + ' ' + response.data);
});
RestangularProvider.setRestangularFields({
id: "_id",
route: "restangularRoute"
});
RestangularProvider.setRequestSuffix('.json');
RestangularProvider.setRequestInterceptor(function (element, operation, route, url) {
});
RestangularProvider.addElementTransformer('accounts', false, function (elem) {
elem.accountName = 'Changed';
return elem;
});
var myRestangular = Restangular.withConfig((configurer: RestangularProvider) => {
configurer.setBaseUrl('/api/v1');
configurer.setExtraFields(['name']);