Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.SystemAdmin =
- getOrgs:
- jasmine.createSpy('getOrgs').and.returnValue this.$q.when orgs
- HRIS:
- install:
- jasmine.createSpy('install').and.returnValue this.$q.when betterworks
- getFiles:
- jasmine.createSpy('getFiles').and.returnValue this.$q.when files
- getCredential:
- jasmine.createSpy('getCredential').and.returnValue this.$q.when betterworks_creds
- regeneratePassword:
- jasmine.createSpy('regeneratePassword').and.returnValue this.$q.when betterworks
- toggle:
- jasmine.createSpy('toggle').and.returnValue this.$q.when betterworks
- this.createController = =>
- controller = this.$controller 'HRISPageController',
- $scope : this.$scope
- SystemAdmin: this.SystemAdmin
- this.$rootScope.$digest()
- return controller
- return
- it 'should initialize', ->
- this.controller = this.createController()
- expect(this.controller.org).toBe null
- expect(this.controller.orgs.length).toBe 3
- it 'should get credentials and files on select', ->
- this.controller = this.createController()
- this.controller.selectOrg betterworks
- expect(this.SystemAdmin.HRIS.getCredential).toHaveBeenCalled()
- expect(this.SystemAdmin.HRIS.getFiles).toHaveBeenCalled()
- expect(this.controller.org.name).toEqual betterworks.name
- expect(this.controller.org.username).toEqual betterworks_creds.username
- expect(this.controller.org.password).toEqual betterworks_creds.password
- expect(this.controller.files).toEqual files
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement