1
0
Fork 0

Added test and method stub for curent database model. Karma tests will fail by intention (jenkins test)

This commit is contained in:
Michael Hackstein 2013-11-14 12:04:57 +01:00
parent 2c69aa70bf
commit 2e9f38f352
4 changed files with 37 additions and 0 deletions

View File

@ -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"
});
}());

View File

@ -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',

View File

@ -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"});
});
});
}());