Skip to content

Commit 82dd423

Browse files
committed
updating angular to 0.9.13 curdling-stare
1 parent f216c1f commit 82dd423

File tree

6 files changed

+391
-260
lines changed

6 files changed

+391
-260
lines changed

app/lib/angular/angular.js

Lines changed: 132 additions & 66 deletions
Large diffs are not rendered by default.

app/lib/angular/angular.min.js

Lines changed: 113 additions & 113 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/lib/angular/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
0.9.12
1+
0.9.13
22

test/lib/angular/angular-mocks.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,28 +101,27 @@ function MockBrowser() {
101101
};
102102

103103

104-
self.xhr = function(method, url, data, callback) {
105-
if (angular.isFunction(data)) {
106-
callback = data;
107-
data = null;
108-
}
104+
self.xhr = function(method, url, data, callback, headers) {
105+
headers = headers || {};
109106
if (data && angular.isObject(data)) data = angular.toJson(data);
110107
if (data && angular.isString(data)) url += "|" + data;
111108
var expect = expectations[method] || {};
112-
var response = expect[url];
113-
if (!response) {
114-
throw {
115-
message: "Unexpected request for method '" + method + "' and url '" + url + "'.",
116-
name: "Unexpected Request"
117-
};
109+
var expectation = expect[url];
110+
if (!expectation) {
111+
throw new Error("Unexpected request for method '" + method + "' and url '" + url + "'.");
118112
}
119113
requests.push(function(){
120-
callback(response.code, response.response);
114+
forEach(expectation.headers, function(value, key){
115+
if (headers[key] !== value) {
116+
throw new Error("Missing HTTP request header: " + key + ": " + value);
117+
}
118+
});
119+
callback(expectation.code, expectation.response);
121120
});
122121
};
123122
self.xhr.expectations = expectations;
124123
self.xhr.requests = requests;
125-
self.xhr.expect = function(method, url, data) {
124+
self.xhr.expect = function(method, url, data, headers) {
126125
if (data && angular.isObject(data)) data = angular.toJson(data);
127126
if (data && angular.isString(data)) url += "|" + data;
128127
var expect = expectations[method] || (expectations[method] = {});
@@ -132,7 +131,7 @@ function MockBrowser() {
132131
response = code;
133132
code = 200;
134133
}
135-
expect[url] = {code:code, response:response};
134+
expect[url] = {code:code, response:response, headers: headers || {}};
136135
}
137136
};
138137
};

0 commit comments

Comments
 (0)