@@ -101,9 +101,9 @@ describe('OC.SetupChecks tests', function() {
101
101
oc_dataURL = "data" ;
102
102
103
103
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*' ] ) ;
104
105
var async = OC . SetupChecks . checkDataProtected ( ) ;
105
-
106
- suite . server . requests [ 0 ] . respond ( 200 , { 'Content-Type' : 'text/plain' } , '*cough*HTACCESSFAIL*cough*' ) ;
106
+ suite . server . respond ( ) ;
107
107
108
108
async . done ( function ( data , s , x ) {
109
109
expect ( data ) . toEqual ( [
@@ -116,9 +116,9 @@ describe('OC.SetupChecks tests', function() {
116
116
} ) ;
117
117
118
118
it ( 'should not return an error if data directory is protected' , function ( done ) {
119
+ suite . server . respondWith ( [ 403 , { "Content-Type" : "text/plain" } , '403' ] ) ;
119
120
var async = OC . SetupChecks . checkDataProtected ( ) ;
120
-
121
- suite . server . requests [ 0 ] . respond ( 403 ) ;
121
+ suite . server . respond ( ) ;
122
122
123
123
async . done ( function ( data , s , x ) {
124
124
expect ( data ) . toEqual ( [ ] ) ;
@@ -127,9 +127,9 @@ describe('OC.SetupChecks tests', function() {
127
127
} ) ;
128
128
129
129
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>' ] ) ;
130
131
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 ( ) ;
133
133
134
134
async . done ( function ( data , s , x ) {
135
135
expect ( data ) . toEqual ( [ ] ) ;
@@ -153,9 +153,7 @@ describe('OC.SetupChecks tests', function() {
153
153
154
154
describe ( 'checkSetup' , function ( ) {
155
155
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 ( [
159
157
200 ,
160
158
{
161
159
'Content-Type' : 'application/json'
@@ -168,7 +166,10 @@ describe('OC.SetupChecks tests', function() {
168
166
isCorrectMemcachedPHPModuleInstalled : true ,
169
167
hasPassedCodeIntegrityCheck : true ,
170
168
} )
171
- ) ;
169
+ ] ) ;
170
+ var async = OC . SetupChecks . checkSetup ( ) ;
171
+ suite . server . respond ( ) ;
172
+
172
173
173
174
async . done ( function ( data , s , x ) {
174
175
expect ( data ) . toEqual ( [
0 commit comments