mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 18:16:45 +00:00
* Fixed #2904 - Recreated from another in-active PR - https://github.com/openMF/community-app/pull/2905 - Had merge conflicts and branch is inactive - Tested the scenarios * Fixed #2904 - Fixed the existing test
23 lines
713 B
JavaScript
23 lines
713 B
JavaScript
describe("RoleController", function () {
|
|
var resourceCallback;
|
|
|
|
beforeEach(function () {
|
|
this.scope = jasmine.createSpyObj("$scope", ['saveSC']);
|
|
this.scope.searchCriteria = {}
|
|
|
|
this.resourceFactory = { roleResource: {
|
|
getAllRoles: jasmine.createSpy('roleResource.getAllRoles()').andCallFake(function (params, callback) {
|
|
resourceCallback = callback;
|
|
})
|
|
}};
|
|
|
|
this.controller = new mifosX.controllers.RoleController(this.scope, this.resourceFactory);
|
|
});
|
|
|
|
it("should get all roles", function () {
|
|
resourceCallback(['role1', 'role2']);
|
|
expect(this.scope.roles).toEqual(['role1', 'role2']);
|
|
});
|
|
|
|
});
|