message: Fix forgot password test mocks
diff: @@ -65,8 +65,8 @@ describe('controllers', function () {
  expect(scope.error).toBe('error')
  }))
  - xit('should find the security question of a user with a known email address', inject(function () {
  - $httpBackend.whenGET('rest/user/security-question?email=known@user.test').respond(200, { question: 'What is your favorite test tool?' })
  + it('should find the security question of a user with a known email address', inject(function () {
  + $httpBackend.whenGET('rest/user/security-question?email=known@user.test').respond(200, { question: { question: 'What is your favorite test tool?' } })
  scope.email = 'known@user.test'
  scope.findSecurityQuestion()
  @@ -75,8 +75,8 @@ describe('controllers', function () {
  expect(scope.securityQuestion).toBe('What is your favorite test tool?')
  }))
  - xit('should not find the security question for an email address not bound to a user', inject(function () {
  - $httpBackend.whenGET('rest/user/security-question?email=unknown@user.test').respond(200, {})
  + it('should not find the security question for an email address not bound to a user', inject(function () {
  + $httpBackend.whenGET('rest/user/security-question?email=unknown@user.test').respond(200, { question: {} })
  scope.email = 'unknown@user.test'
  scope.findSecurityQuestion()
  @@ -85,6 +85,16 @@ describe('controllers', function () {
  expect(scope.securityQuestion).toBeUndefined()
  }))
  + it('should not have a security question when lookup by email address failed', inject(function () {
  + $httpBackend.whenGET('rest/user/security-question?email=some@user.test').respond(500)
  + scope.email = 'some@user.test'
  +
  + scope.findSecurityQuestion()
  + $httpBackend.flush()
  +
  + expect(scope.securityQuestion).toBeUndefined()
  + }))
  +
  it('should find not attempt to find security question for empty email address', inject(function () {
  scope.email = undefined
  