Commit dff7efd4 authored by Randall Leeds's avatar Randall Leeds

Move the account controller into the auth module

parent 1ac5b1a8
......@@ -3,7 +3,6 @@ imports = [
'ngRoute'
'h.auth'
'h.controllers'
'h.controllers.AccountManagement'
'h.directives'
'h.filters'
'h.streamsearch'
......
class AccountManagement
@inject = ['$scope', '$filter', 'flash', 'session', 'identity', 'formHelpers']
imports = [
'h.session'
]
class AccountController
@inject = ['$scope', '$filter', 'flash', 'session', 'identity', 'formHelpers']
constructor: ($scope, $filter, flash, session, identity, formHelpers) ->
persona_filter = $filter('persona')
......@@ -69,5 +72,5 @@ class AccountManagement
promise.$promise.then(successHandler, errorHandler)
angular.module('h.controllers.AccountManagement', [])
.controller('AccountManagement', AccountManagement)
angular.module('h.account', imports)
.controller('AccountController', AccountController)
......@@ -2,7 +2,7 @@ assert = chai.assert
sinon.assert.expose assert, prefix: null
sandbox = sinon.sandbox.create()
describe 'h.controllers.AccountManagement', ->
describe 'h.account.AccountController', ->
$scope = null
fakeFlash = null
fakeSession = null
......@@ -12,6 +12,8 @@ describe 'h.controllers.AccountManagement', ->
disableUserPromise = null
createController = null
beforeEach module('h.account')
beforeEach module ($provide, $filterProvider) ->
fakeSession = {}
fakeFlash = sandbox.spy()
......@@ -29,8 +31,6 @@ describe 'h.controllers.AccountManagement', ->
$provide.value 'formHelpers', fakeFormHelpers
return
beforeEach module('h.controllers.AccountManagement')
beforeEach inject ($rootScope, $q, $controller) ->
$scope = $rootScope.$new()
$scope.persona = 'egon@columbia.edu'
......@@ -41,7 +41,7 @@ describe 'h.controllers.AccountManagement', ->
fakeSession.disable_user = sandbox.stub().returns($promise: disableUserPromise)
createController = ->
$controller('AccountManagement', {$scope: $scope})
$controller('AccountController', {$scope: $scope})
describe '.submit', ->
createFakeForm = (overrides={}) ->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment