community-app/test/spec/controllers/client/ClientControllerSpec.js
2014-01-28 06:40:38 +05:30

20 lines
771 B
JavaScript

describe("ClientController", function() {
var resourceCallback;
beforeEach(function() {
this.scope = jasmine.createSpyObj("$scope", ['$clients']);
this.resourceFactory = {clientResource: {
getAllClients: jasmine.createSpy('clientResource.getAllClients()').andCallFake(function(callback) {
resourceCallback = callback;
})
}};
this.paginatorService = jasmine.createSpyObj("paginatorService", ["paginate"]);
this.controller = new mifosX.controllers.ClientController(this.scope, this.resourceFactory, this.paginatorService);
});
it("should populate the scope with paginated clients", function() {
expect(this.paginatorService.paginate).toHaveBeenCalled();
});
});