1
0
Fork 0

Added implementation for a current database model

This commit is contained in:
Michael Hackstein 2013-11-14 13:28:12 +01:00
parent 2e9f38f352
commit 0996649a6e
3 changed files with 4 additions and 4 deletions

View File

@ -5,8 +5,6 @@
"use strict";
window.CurrentDatabase = Backbone.Model.extend({
url: "/_api/database/current"
});
}());

View File

@ -13,9 +13,11 @@
});
it("should request /_api/database/current on fetch", function() {
spyOn($, "ajax");
spyOn($, "ajax").andCallFake(function(opt) {
expect(opt.url).toEqual("/_api/database/current");
expect(opt.type).toEqual("GET");
});
model.fetch();
expect($.ajax).toHaveBeenCalledWith("/_api/database/current", {type: "GET"});
});
});