summaryrefslogtreecommitdiffstats
path: root/core/js/tests
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-10-10 13:33:57 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-10-10 13:48:56 +0200
commitd143b43a0454528905c751579b4ab482abe39f36 (patch)
treecb1a48e5b88151e041ea9715df9e80d5e3f161c7 /core/js/tests
parentf64bd62f8e438fe36a6c070ac445a07ad22439e4 (diff)
downloadnextcloud-server-d143b43a0454528905c751579b4ab482abe39f36.tar.gz
nextcloud-server-d143b43a0454528905c751579b4ab482abe39f36.zip
Make possible to set the expected status of the well known URL check
The check is based on the HTTP status returned by the URL, and different URLs may return different status (for example, DAV returns 207, while a service like WebFinger would return 200), so the expected status needs to be set depending on the URL. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'core/js/tests')
-rw-r--r--core/js/tests/specs/setupchecksSpec.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js
index 38a39cdd746..a058a689ed2 100644
--- a/core/js/tests/specs/setupchecksSpec.js
+++ b/core/js/tests/specs/setupchecksSpec.js
@@ -61,8 +61,8 @@ describe('OC.SetupChecks tests', function() {
});
describe('checkWellKnownUrl', function() {
- it('should fail with another response status code than 207', function(done) {
- var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav', 'http://example.org/PLACEHOLDER', true);
+ it('should fail with another response status code than the expected one', function(done) {
+ var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav', 'http://example.org/PLACEHOLDER', true, 207);
suite.server.requests[0].respond(200);
@@ -75,7 +75,18 @@ describe('OC.SetupChecks tests', function() {
});
});
- it('should return no error with a response status code of 207', function(done) {
+ it('should return no error with the expected response status code', function(done) {
+ var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav', 'http://example.org/PLACEHOLDER', true, 207);
+
+ suite.server.requests[0].respond(207);
+
+ async.done(function( data, s, x ){
+ expect(data).toEqual([]);
+ done();
+ });
+ });
+
+ it('should return no error with the default expected response status code', function(done) {
var async = OC.SetupChecks.checkWellKnownUrl('/.well-known/caldav', 'http://example.org/PLACEHOLDER', true);
suite.server.requests[0].respond(207);