mirror of https://gitee.com/bigwinds/arangodb
Added test and method stub for curent database model. Karma tests will fail by intention (jenkins test)
This commit is contained in:
parent
2c69aa70bf
commit
2e9f38f352
|
@ -0,0 +1,12 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*global Backbone, window*/
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
window.CurrentDatabase = Backbone.Model.extend({
|
||||
|
||||
url: "/_api/database/current"
|
||||
|
||||
});
|
||||
}());
|
|
@ -76,6 +76,7 @@ module.exports = function(karma) {
|
|||
'test/mocks/disableEJS.js',
|
||||
|
||||
// Models
|
||||
'frontend/js/models/currentDatabase.js',
|
||||
'frontend/js/models/arangoCollection.js',
|
||||
'frontend/js/models/arangoDatabase.js',
|
||||
'frontend/js/models/arangoDocument.js',
|
||||
|
@ -123,6 +124,7 @@ module.exports = function(karma) {
|
|||
|
||||
// Specs
|
||||
'test/specs/arango/arangoSpec.js',
|
||||
'test/specs/models/currentDatabaseSpec.js',
|
||||
'test/specs/views/collectionViewSpec.js',
|
||||
'test/specs/views/collectionsViewSpec.js',
|
||||
'test/specs/views/foxxEditViewSpec.js',
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,23 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true, browser: true*/
|
||||
/*global describe, beforeEach, afterEach, it, spyOn, expect*/
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
describe("The current database", function() {
|
||||
|
||||
var model;
|
||||
|
||||
beforeEach(function() {
|
||||
model = new window.CurrentDatabase();
|
||||
});
|
||||
|
||||
it("should request /_api/database/current on fetch", function() {
|
||||
spyOn($, "ajax");
|
||||
model.fetch();
|
||||
expect($.ajax).toHaveBeenCalledWith("/_api/database/current", {type: "GET"});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}());
|
Loading…
Reference in New Issue