mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-18 23:50:23 +00:00
fixed isNumber to angular.isNumber for mocks outside of angular
This commit is contained in:
parent
80e12276f4
commit
80bd0c273b
3 changed files with 4 additions and 4 deletions
|
|
@ -234,7 +234,7 @@ angularService('$xhr', function($browser, $error, $log){
|
|||
|
||||
angularService('$xhr.error', function($log){
|
||||
return function(request, response){
|
||||
$log.error(response);
|
||||
$log.error('ERROR: XHR: ' + request.url, request, response);
|
||||
};
|
||||
}, {inject:['$log']});
|
||||
|
||||
|
|
@ -272,7 +272,7 @@ angularService('$xhr.bulk', function($xhr, $error, $log){
|
|||
if (response.status == 200) {
|
||||
(currentRequests[i].callback || noop)(response.status, response.response);
|
||||
} else {
|
||||
$error(currentRequests[i], {status: response.status, body:response.response});
|
||||
$error(currentRequests[i], response);
|
||||
}
|
||||
} catch(e) {
|
||||
$log.error(e);
|
||||
|
|
|
|||
2
test/angular-mocks.js
vendored
2
test/angular-mocks.js
vendored
|
|
@ -54,7 +54,7 @@ function MockBrowser() {
|
|||
var expect = expectations[method] || (expectations[method] = {});
|
||||
return {
|
||||
respond: function(code, response) {
|
||||
if (!isNumber(code)) {
|
||||
if (!angular.isNumber(code)) {
|
||||
response = code;
|
||||
code = 200;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ describe("service", function(){
|
|||
expect(typeof cb).toEqual('function');
|
||||
expect($xhrError).wasCalledWith(
|
||||
{url:'/req1', method:'GET', data:null, callback:cb},
|
||||
{status:404, body:'NotFound'});
|
||||
{status:404, response:'NotFound'});
|
||||
|
||||
expect(log).toEqual('"second";DONE');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue