@@ -51,14 +51,14 @@ define([ 'require', './src/authorize', './src/config'], function(require, Author
5151 {
5252 desc : "Authorize redirects to the provider's OAuth location" ,
5353 run : function ( env , test ) {
54- var authUrl = 'http://storage.provider.com/oauth' ;
54+ var authURL = 'http://storage.provider.com/oauth' ;
5555 var scope = 'contacts:r' ;
5656 var redirectUri = 'http://awesome.app.com/#custom/path' ;
5757 var clientId = 'http://awesome.app.com/' ;
5858
5959 this . localStorageAvailable = function ( ) { return true ; } ;
6060
61- Authorize ( this , authUrl , scope , redirectUri , clientId ) ;
61+ Authorize ( this , { authURL , scope, redirectUri, clientId} ) ;
6262
6363 var expectedUrl = 'http://storage.provider.com/oauth?redirect_uri=http%3A%2F%2Fawesome.app.com%2F&scope=contacts%3Ar&client_id=http%3A%2F%2Fawesome.app.com%2F&state=custom%2Fpath&response_type=token' ;
6464 test . assert ( document . location . href , expectedUrl ) ;
@@ -68,14 +68,14 @@ define([ 'require', './src/authorize', './src/config'], function(require, Author
6868 {
6969 desc : "Authorize redirects to the provider's OAuth location with empty fragment" ,
7070 run : function ( env , test ) {
71- var authUrl = 'http://storage.provider.com/oauth' ;
71+ var authURL = 'http://storage.provider.com/oauth' ;
7272 var scope = 'contacts:r' ;
7373 var redirectUri = 'http://awesome.app.com/#' ;
7474 var clientId = 'http://awesome.app.com/' ;
7575
7676 this . localStorageAvailable = function ( ) { return true ; } ;
7777
78- Authorize ( this , authUrl , scope , redirectUri , clientId ) ;
78+ Authorize ( this , { authURL , scope, redirectUri, clientId} ) ;
7979
8080 var expectedUrl = 'http://storage.provider.com/oauth?redirect_uri=http%3A%2F%2Fawesome.app.com%2F&scope=contacts%3Ar&client_id=http%3A%2F%2Fawesome.app.com%2F&response_type=token' ;
8181 test . assert ( document . location . href , expectedUrl ) ;
@@ -86,7 +86,7 @@ define([ 'require', './src/authorize', './src/config'], function(require, Author
8686 desc : "Authorize doesn't redirect, but opens an in-app-browser window" ,
8787 run : function ( env , test ) {
8888 document . location . href = 'file:///some/cordova/path' ;
89- var authUrl = 'http://storage.provider.com/oauth' ;
89+ var authURL = 'http://storage.provider.com/oauth' ;
9090 var scope = 'contacts:r' ;
9191 var redirectUri = 'http://awesome.app.com/#' ;
9292 var clientId = 'http://awesome.app.com/' ;
@@ -97,10 +97,11 @@ define([ 'require', './src/authorize', './src/config'], function(require, Author
9797
9898 Authorize . openWindow = function ( url , uri ) {
9999 test . assertAnd ( uri , redirectUri ) ;
100+ delete global . cordova ;
100101 test . done ( ) ;
101102 } ;
102103
103- Authorize ( this , authUrl , scope , redirectUri , clientId ) ;
104+ Authorize ( this , { authURL , scope, redirectUri, clientId} ) ;
104105
105106 test . assertAnd ( document . location . href , 'file:///some/cordova/path' ) ;
106107 }
0 commit comments