fix unit test response auth problem

This commit is contained in:
mauriziovitale84 2016-07-18 13:20:33 +01:00
parent 1d3cf1330d
commit 68bc0c7949
2 changed files with 4 additions and 7 deletions

View File

@ -72,7 +72,7 @@ export class AlfrescoAuthenticationECM extends AlfrescoAuthenticationBase implem
return Observable.fromPromise(this.callApiLogin(username, password)) return Observable.fromPromise(this.callApiLogin(username, password))
.map((response: any) => { .map((response: any) => {
return {type: this.TYPE, ticket: response.entry.id}; return {type: this.TYPE, ticket: response};
}) })
.catch(this.handleError); .catch(this.handleError);
} }

View File

@ -33,12 +33,9 @@ describe('AlfrescoAuthentication', () => {
service; service;
fakePromiseECM = new Promise(function (resolve, reject) { fakePromiseECM = new Promise(function (resolve, reject) {
resolve({ resolve(
entry: { 'fake-post-ticket-ECM'
userId: 'fake-username', );
id: 'fake-post-ticket-ECM'
}
});
reject({ reject({
response: { response: {
error: 'fake-error' error: 'fake-error'