~jderose/ubuntu/vivid/couchdb/fix-1457464

« back to all changes in this revision

Viewing changes to src/fauxton/app/modules/documents/tests/resourcesSpec.js

  • Committer: Package Import Robot
  • Author(s): Jason Gerard DeRose
  • Date: 2013-12-01 16:55:05 UTC
  • mfrom: (1.3.5)
  • Revision ID: package-import@ubuntu.com-20131201165505-for2toyl58mhzwj2
Tags: 1.5.0-0ubuntu1
* New upstream release (LP: #1254371)
* Don't include `couchdb` info page in `couchdb-bin` binary package as it
  provides no meaningful benefit over the `couchdb` man page (note this change
  means we don't need to add a Build-Depends on `install-info` for Trusty)
* Remove Build-Depends: texlive-latex-base, texlive-latex-recommended,
  texlive-latex-extra, texlive-fonts-recommended, texinfo (as documentation
  thus produced doesn't get included in the binary packages anyway)
* debian/rules: don't call ./configure with --enable-strictness as we dropped
  Build-Depends on `texlive-*`, `texinfo`, plus didn't add `install-info` 
* Add Build-Depends: lsb-release (used for [vendor] info in default.ini)
* debian/rules: insert proper [vendor] info in default.ini (note this should
  be improved once there is a better mechanism upstream)
* debian/couchdb.upstart: start on filesystem and static-network-up,
  stop on deconfiguring-networking, plus add "author" line

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
 
2
// use this file except in compliance with the License. You may obtain a copy of
 
3
// the License at
 
4
//
 
5
//   http://www.apache.org/licenses/LICENSE-2.0
 
6
//
 
7
// Unless required by applicable law or agreed to in writing, software
 
8
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
9
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
10
// License for the specific language governing permissions and limitations under
 
11
// the License.
 
12
define([
 
13
       'modules/documents/resources',
 
14
      'testUtils'
 
15
], function (Models, testUtils) {
 
16
  var assert = testUtils.assert;
 
17
 
 
18
  describe('IndexCollection', function () {
 
19
    var collection;
 
20
    beforeEach(function () {
 
21
      collection = new Models.IndexCollection([{
 
22
        id:'myId1',
 
23
        doc: 'num1'
 
24
      },
 
25
      {
 
26
        id:'myId2',
 
27
        doc: 'num2'
 
28
      }], {
 
29
        database: {id: 'databaseId'},
 
30
        design: '_design/myDoc'
 
31
      });
 
32
 
 
33
    });
 
34
 
 
35
    it('Should return urlNext', function () {
 
36
      var url = collection.urlNextPage(20);
 
37
 
 
38
      assert.equal(url, 'database/databaseId/_design/myDoc/_view/?limit=20&reduce=false&startkey_docid=%22myId2%22&startkey=%22myId2%22');
 
39
 
 
40
    });
 
41
 
 
42
    it('Should return urlPrevious', function () {
 
43
      var url = collection.urlPreviousPage(20, 'myId1');
 
44
 
 
45
      assert.equal(url, 'database/databaseId/_design/myDoc/_view/?limit=20&reduce=false&startkey_docid=%22myId1%22&startkey=%22myId1%22');
 
46
 
 
47
    });
 
48
 
 
49
  });
 
50
 
 
51
  describe('AllDocs', function () {
 
52
    var collection;
 
53
    beforeEach(function () {
 
54
      collection = new Models.AllDocs([{
 
55
        _id:'myId1',
 
56
        doc: 'num1'
 
57
      },
 
58
      {
 
59
        _id:'myId2',
 
60
        doc: 'num2'
 
61
      }], {
 
62
        database: {id: 'databaseId'},
 
63
        params: {limit: 20}
 
64
      });
 
65
 
 
66
    });
 
67
 
 
68
    it('Should return urlNext', function () {
 
69
      var url = collection.urlNextPage(20);
 
70
 
 
71
      assert.equal(url, 'database/databaseId/_all_docs?limit=21&startkey_docid=%22myId2%22&startkey=%22myId2%22');
 
72
 
 
73
    });
 
74
 
 
75
     it('Should return urlPrevious', function () {
 
76
      var url = collection.urlPreviousPage(20, 'myId1');
 
77
      assert.equal(url, 'database/databaseId/_all_docs?limit=20&startkey_docid=%22myId1%22&startkey=%22myId1%22');
 
78
    });
 
79
 
 
80
 
 
81
  });
 
82
 
 
83
});
 
84