allow set set jasmine_config object before jasmine libs are loaded
[mkws-moved-to-github.git] / test / spec / mkws-pazpar2.js
index 0cca4d7..66b0557 100644 (file)
@@ -9,8 +9,10 @@ var debug = function (text) {
         mkws.debug_function(text)
     }
 
-
-var jasmine_config = {};
+// Define empty mkws_config for simple applications that don't define it.
+if (jasmine_config == null || typeof jasmine_config != 'object') {
+    var jasmine_config = {};
+}
 
 /* check config for jasmine test
  *
@@ -38,6 +40,7 @@ beforeEach(function () {
         if (!jasmine_config.hasOwnProperty(key)) {
             jasmine_config[key] = jasmine_config_default[key];
         }
+       debug("jasmine config: " + key + " => " + jasmine_config[key]);
     }
 });
 
@@ -279,7 +282,7 @@ describe("Show record", function () {
         debug("extracted URL from record: " + url);
 
         expect(url).not.toBe(null);
-        expect(url).toMatch(/^http:\/\/[a-z0-9]+\.[0-9a-z].*\//i);
+        expect(url).toMatch(/^https?:\/\/[a-z0-9]+\.[0-9a-z].*\//i);
     });
 });