fix($browser.xhr): change method "JSON" to "JSONP"

Breaks "JSON" xhr method is now called "JSONP"
This commit is contained in:
Vojta Jina
2011-08-10 15:59:55 +02:00
committed by Igor Minar
parent 0c8b35681e
commit 45f47ff6cd
5 changed files with 14 additions and 14 deletions

View File

@@ -111,7 +111,7 @@ describe('browser', function() {
});
describe('xhr', function() {
describe('JSON', function() {
describe('JSONP', function() {
var log;
function callback(code, data) {
@@ -129,7 +129,7 @@ describe('browser', function() {
it('should add script tag for JSONP request', function() {
var notify = jasmine.createSpy('notify');
browser.xhr('JSON', 'http://example.org/path?cb=JSON_CALLBACK', null, callback);
browser.xhr('JSONP', 'http://example.org/path?cb=JSON_CALLBACK', null, callback);
browser.notifyWhenNoOutstandingRequests(notify);
expect(notify).not.toHaveBeenCalled();
expect(scripts.length).toEqual(1);
@@ -148,7 +148,7 @@ describe('browser', function() {
it('should call callback when script fails to load', function() {
browser.xhr('JSON', 'http://example.org/path?cb=JSON_CALLBACK', null, callback);
browser.xhr('JSONP', 'http://example.org/path?cb=JSON_CALLBACK', null, callback);
var script = scripts[0];
expect(typeof script.onload).toBe('function');
expect(typeof script.onerror).toBe('function');
@@ -160,7 +160,7 @@ describe('browser', function() {
it('should update the outstandingRequests counter for successful requests', function() {
var notify = jasmine.createSpy('notify');
browser.xhr('JSON', 'http://example.org/path?cb=JSON_CALLBACK', null, callback);
browser.xhr('JSONP', 'http://example.org/path?cb=JSON_CALLBACK', null, callback);
browser.notifyWhenNoOutstandingRequests(notify);
expect(notify).not.toHaveBeenCalled();
@@ -175,7 +175,7 @@ describe('browser', function() {
it('should update the outstandingRequests counter for failed requests', function() {
var notify = jasmine.createSpy('notify');
browser.xhr('JSON', 'http://example.org/path?cb=JSON_CALLBACK', null, callback);
browser.xhr('JSONP', 'http://example.org/path?cb=JSON_CALLBACK', null, callback);
browser.notifyWhenNoOutstandingRequests(notify);
expect(notify).not.toHaveBeenCalled();