@@ -101,9 +101,9 @@ describe('OC.SetupChecks tests', function() {
101101 oc_dataURL = "data" ;
102102
103103 it ( 'should return an error if data directory is not protected' , function ( done ) {
104+ suite . server . respondWith ( [ 200 , { "Content-Type" : "text/plain" } , '*cough*HTACCESSFAIL*cough*' ] ) ;
104105 var async = OC . SetupChecks . checkDataProtected ( ) ;
105-
106- suite . server . requests [ 0 ] . respond ( 200 , { 'Content-Type' : 'text/plain' } , '*cough*HTACCESSFAIL*cough*' ) ;
106+ suite . server . respond ( ) ;
107107
108108 async . done ( function ( data , s , x ) {
109109 expect ( data ) . toEqual ( [
@@ -116,9 +116,9 @@ describe('OC.SetupChecks tests', function() {
116116 } ) ;
117117
118118 it ( 'should not return an error if data directory is protected' , function ( done ) {
119+ suite . server . respondWith ( [ 403 , { "Content-Type" : "text/plain" } , '403' ] ) ;
119120 var async = OC . SetupChecks . checkDataProtected ( ) ;
120-
121- suite . server . requests [ 0 ] . respond ( 403 ) ;
121+ suite . server . respond ( ) ;
122122
123123 async . done ( function ( data , s , x ) {
124124 expect ( data ) . toEqual ( [ ] ) ;
@@ -127,9 +127,9 @@ describe('OC.SetupChecks tests', function() {
127127 } ) ;
128128
129129 it ( 'should not return an error if data directory is protected and redirects to main page' , function ( done ) {
130+ suite . server . respondWith ( [ 200 , { 'Content-Type' : 'text/plain' } , '<html><body>blah</body></html>' ] ) ;
130131 var async = OC . SetupChecks . checkDataProtected ( ) ;
131-
132- suite . server . requests [ 0 ] . respond ( 200 , { 'Content-Type' : 'text/plain' } , '<html><body>blah</body></html>' ) ;
132+ suite . server . respond ( ) ;
133133
134134 async . done ( function ( data , s , x ) {
135135 expect ( data ) . toEqual ( [ ] ) ;
@@ -153,9 +153,7 @@ describe('OC.SetupChecks tests', function() {
153153
154154 describe ( 'checkSetup' , function ( ) {
155155 it ( 'should return an error if server has no internet connection' , function ( done ) {
156- var async = OC . SetupChecks . checkSetup ( ) ;
157-
158- suite . server . requests [ 0 ] . respond (
156+ suite . server . respondWith ( [
159157 200 ,
160158 {
161159 'Content-Type' : 'application/json'
@@ -168,7 +166,10 @@ describe('OC.SetupChecks tests', function() {
168166 isCorrectMemcachedPHPModuleInstalled : true ,
169167 hasPassedCodeIntegrityCheck : true ,
170168 } )
171- ) ;
169+ ] ) ;
170+ var async = OC . SetupChecks . checkSetup ( ) ;
171+ suite . server . respond ( ) ;
172+
172173
173174 async . done ( function ( data , s , x ) {
174175 expect ( data ) . toEqual ( [
0 commit comments