Created
May 29, 2017 20:15
-
-
Save washingtonsoares/582a64f86b0b44ca8f028b9b3698d93d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var httpBackendMock = function() { | |
angular.module('httpBackendMock', ['defina-se-backoffice-ui']) | |
.factory('loginInterceptor', function() { | |
return { | |
request: function(config) { | |
if(config.url.includes('get-authenticated-user')) { | |
config.url = config.url + '?role=student' | |
console.log(config) | |
} | |
return config; | |
}, | |
response: function(config) { | |
console.log(config) | |
return config; | |
} | |
} | |
}) | |
.config(function($httpProvider){ | |
$httpProvider.interceptors.push('loginInterceptor') | |
}) | |
} | |
browser.addMockModule('httpBackendMock', httpBackendMock) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment