Renamed response function to makeResponse so that it doesn't conflict with the builtin method
This commit is contained in:
parent
54864a45d3
commit
f480e105c2
@ -212,7 +212,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
var stub = stubTracker.findStub(this.url, data);
|
||||
if (stub) {
|
||||
this.response(stub);
|
||||
this.makeResponse(stub);
|
||||
}
|
||||
},
|
||||
|
||||
@ -248,7 +248,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
responseText: null,
|
||||
|
||||
response: function(response) {
|
||||
makeResponse: function(response) {
|
||||
this.status = response.status;
|
||||
this.statusText = response.statusText || "";
|
||||
this.responseText = response.responseText || "";
|
||||
|
@ -77,7 +77,7 @@ describe("FakeXMLHttpRequest", function() {
|
||||
describe("when a response comes in", function() {
|
||||
it("should have a readyState of 4 (loaded)", function() {
|
||||
xhr.onreadystatechange.calls.reset();
|
||||
xhr.response({status: 200});
|
||||
xhr.makeResponse({status: 200});
|
||||
expect(xhr.readyState).toEqual(4);
|
||||
expect(xhr.onreadystatechange).toHaveBeenCalled();
|
||||
});
|
||||
|
@ -187,7 +187,7 @@ describe("Jasmine Mock Ajax (for toplevel)", function() {
|
||||
|
||||
request = mockAjax.requests.mostRecent();
|
||||
response = {status: 200, statusText: "OK", contentType: "text/html", responseText: "OK!"};
|
||||
request.response(response);
|
||||
request.makeResponse(response);
|
||||
|
||||
sharedContext.responseCallback = success;
|
||||
sharedContext.status = response.status;
|
||||
@ -222,7 +222,7 @@ describe("Jasmine Mock Ajax (for toplevel)", function() {
|
||||
request = mockAjax.requests.mostRecent();
|
||||
var responseObject = {status: 200, statusText: "OK", contentType: "application/json", responseText: '{"foo":"bar"}'};
|
||||
|
||||
request.response(responseObject);
|
||||
request.makeResponse(responseObject);
|
||||
|
||||
sharedContext.responseCallback = success;
|
||||
sharedContext.status = responseObject.status;
|
||||
@ -262,7 +262,7 @@ describe("Jasmine Mock Ajax (for toplevel)", function() {
|
||||
|
||||
request = mockAjax.requests.mostRecent();
|
||||
response = {status: 200, statusText: "OK", responseText: '{"foo": "valid JSON, dammit."}'};
|
||||
request.response(response);
|
||||
request.makeResponse(response);
|
||||
|
||||
sharedContext.responseCallback = success;
|
||||
sharedContext.status = response.status;
|
||||
@ -296,7 +296,7 @@ describe("Jasmine Mock Ajax (for toplevel)", function() {
|
||||
|
||||
request = mockAjax.requests.mostRecent();
|
||||
response = {status: 0, statusText: "ABORT", responseText: '{"foo": "whoops!"}'};
|
||||
request.response(response);
|
||||
request.makeResponse(response);
|
||||
|
||||
sharedContext.responseCallback = error;
|
||||
sharedContext.status = 0;
|
||||
@ -331,7 +331,7 @@ describe("Jasmine Mock Ajax (for toplevel)", function() {
|
||||
|
||||
request = mockAjax.requests.mostRecent();
|
||||
response = {status: 500, statusText: "SERVER ERROR", contentType: "text/html", responseText: "(._){"};
|
||||
request.response(response);
|
||||
request.makeResponse(response);
|
||||
|
||||
sharedContext.responseCallback = error;
|
||||
sharedContext.status = response.status;
|
||||
|
Loading…
Reference in New Issue
Block a user