mirror of https://gitee.com/bigwinds/arangodb
added tests for arangoCollectionModel
This commit is contained in:
parent
609b8139c5
commit
ab01569204
|
@ -5,8 +5,13 @@
|
||||||
(function() {
|
(function() {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
var myCollection;
|
||||||
|
|
||||||
|
beforeEach(function() {
|
||||||
|
myCollection = new window.arangoCollectionModel();
|
||||||
|
});
|
||||||
|
|
||||||
describe("Arango Collection Model", function() {
|
describe("Arango Collection Model", function() {
|
||||||
var myCollection = new window.arangoCollectionModel();
|
|
||||||
it("verifies urlRoot", function() {
|
it("verifies urlRoot", function() {
|
||||||
expect(myCollection.urlRoot).toEqual('/_api/collection');
|
expect(myCollection.urlRoot).toEqual('/_api/collection');
|
||||||
});
|
});
|
||||||
|
@ -14,7 +19,6 @@
|
||||||
|
|
||||||
describe("Arango Database Model", function() {
|
describe("Arango Database Model", function() {
|
||||||
it("verifies defaults", function() {
|
it("verifies defaults", function() {
|
||||||
var myCollection = new window.arangoCollectionModel();
|
|
||||||
expect(myCollection.get('id')).toEqual('');
|
expect(myCollection.get('id')).toEqual('');
|
||||||
expect(myCollection.get('name')).toEqual('');
|
expect(myCollection.get('name')).toEqual('');
|
||||||
expect(myCollection.get('status')).toEqual('');
|
expect(myCollection.get('status')).toEqual('');
|
||||||
|
@ -45,4 +49,52 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("Arango Database Model", function() {
|
||||||
|
it("verifies getProperties", function() {
|
||||||
|
var id = "4711";
|
||||||
|
spyOn($, "ajax").andCallFake(function(opt) {
|
||||||
|
expect(opt.url).toEqual("/_api/collection/" + id + "/properties");
|
||||||
|
expect(opt.type).toEqual("GET");
|
||||||
|
});
|
||||||
|
|
||||||
|
myCollection.getProperties();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("Arango Database Model", function() {
|
||||||
|
it("verifies getFigures", function() {
|
||||||
|
var id = "4711";
|
||||||
|
spyOn($, "ajax").andCallFake(function(opt) {
|
||||||
|
expect(opt.url).toEqual("/_api/collection/" + id + "/figures");
|
||||||
|
expect(opt.type).toEqual("GET");
|
||||||
|
});
|
||||||
|
|
||||||
|
myCollection.getFigures();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("Arango Database Model", function() {
|
||||||
|
it("verifies getRevision", function() {
|
||||||
|
var id = "4711";
|
||||||
|
spyOn($, "ajax").andCallFake(function(opt) {
|
||||||
|
expect(opt.url).toEqual("/_api/collection/" + id + "/revision");
|
||||||
|
expect(opt.type).toEqual("GET");
|
||||||
|
});
|
||||||
|
|
||||||
|
myCollection.getRevision();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("Arango Database Model", function() {
|
||||||
|
it("verifies getIndex", function() {
|
||||||
|
var id = "4711";
|
||||||
|
spyOn($, "ajax").andCallFake(function(opt) {
|
||||||
|
expect(opt.url).toEqual("/_api/index/?collection=" + id);
|
||||||
|
expect(opt.type).toEqual("GET");
|
||||||
|
});
|
||||||
|
|
||||||
|
myCollection.getIndex();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
}());
|
}());
|
Loading…
Reference in New Issue