vendor/assets/javascripts/angular-mocks.js in angularjs-rails-1.2.4 vs vendor/assets/javascripts/angular-mocks.js in angularjs-rails-1.2.5
- old
+ new
@@ -1,7 +1,7 @@
/**
- * @license AngularJS v1.2.4
+ * @license AngularJS v1.2.5
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular, undefined) {
@@ -1092,11 +1092,12 @@
*/
function createHttpBackendMock($rootScope, $delegate, $browser) {
var definitions = [],
expectations = [],
responses = [],
- responsesPush = angular.bind(responses, responses.push);
+ responsesPush = angular.bind(responses, responses.push),
+ copy = angular.copy;
function createResponse(status, data, headers) {
if (angular.isFunction(status)) return status;
return function() {
@@ -1124,10 +1125,10 @@
return handleResponse;
function handleResponse() {
var response = wrapped.response(method, url, data, headers);
xhr.$$respHeaders = response[2];
- callback(response[0], response[1], xhr.getAllResponseHeaders());
+ callback(copy(response[0]), copy(response[1]), xhr.getAllResponseHeaders());
}
function handleTimeout() {
for (var i = 0, ii = responses.length; i < ii; i++) {
if (responses[i] === handleResponse) {