Deprecated 'collection' parameter in favor of 'cq' - fixes #92
Change-Id: I51f0197da3a182fc4d4cd35f12ccb88cce3f8833
diff --git a/dev/js/spec/tourSpec.js b/dev/js/spec/tourSpec.js
index 18d3b4e..55307b4 100644
--- a/dev/js/spec/tourSpec.js
+++ b/dev/js/spec/tourSpec.js
@@ -14,11 +14,11 @@
"<input autocapitalize='off' autocomplete='off' autocorrect='off' autofocus='autofocus' id='q-field' name='q' placeholder='Finde ...' spellcheck='false' type='search'>" +
"<button type='submit' id='qsubmit' title='Los!'><span>Los!</span></button>" +
"</div>" +
- "<!-- Search in the following virtual collection -->"+
+ "<!-- Search in the following virtual corpus -->"+
"<div id='vc-view'></div>" +
"in" +
"<span id='vc-choose' class='select'><span>allen Korpora</span></span>" +
- "<input id='collection' name='collection' type='text' style='display: none;'>" +
+ "<input id='cq' name='cq' type='text' style='display: none;'>" +
"mit" +
"<span class='select'>" +
"<select id='ql-field' name='ql' style='display: none;'>" +
diff --git a/dev/js/spec/vcSpec.js b/dev/js/spec/vcSpec.js
index 564b8d6..388a26d 100644
--- a/dev/js/spec/vcSpec.js
+++ b/dev/js/spec/vcSpec.js
@@ -1561,7 +1561,7 @@
);
});
- it('should be deserializable from collection 1', function () {
+ it('should be deserializable from collection/corpus 1', function () {
var kq = {
"matches":["..."],
"collection":{
@@ -1624,6 +1624,13 @@
var vc = vcClass.create().fromJson(kq["collection"]);
expect(vc.toQuery()).toEqual('(title = "Der Birnbaum" & pubPlace = "Mannheim" & (subTitle = "Aufzucht und Pflege" | subTitle = "Gedichte")) | pubDate since 2015-03-05');
+
+ kq["corpus"] = kq["collection"]
+ delete kq["collection"]
+
+ vc = vcClass.create().fromJson(kq["corpus"]);
+ expect(vc.toQuery()).toEqual('(title = "Der Birnbaum" & pubPlace = "Mannheim" & (subTitle = "Aufzucht und Pflege" | subTitle = "Gedichte")) | pubDate since 2015-03-05');
+
});
it('should be deserializable from collection 2', function () {
@@ -1692,6 +1699,7 @@
expect(vc.toQuery()).toEqual('availability = /CC-BY.*/ & author = "Goethe"');
});
+
it('shouldn\'t be deserializable from collection with unknown type', function () {
var kq = {
"@type" : "koral:doc",