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 = [ ...@@ -3,7 +3,6 @@ imports = [
'ngRoute' 'ngRoute'
'h.auth' 'h.auth'
'h.controllers' 'h.controllers'
'h.controllers.AccountManagement'
'h.directives' 'h.directives'
'h.filters' 'h.filters'
'h.streamsearch' 'h.streamsearch'
......
class AccountManagement imports = [
@inject = ['$scope', '$filter', 'flash', 'session', 'identity', 'formHelpers'] 'h.session'
]
class AccountController
@inject = ['$scope', '$filter', 'flash', 'session', 'identity', 'formHelpers']
constructor: ($scope, $filter, flash, session, identity, formHelpers) -> constructor: ($scope, $filter, flash, session, identity, formHelpers) ->
persona_filter = $filter('persona') persona_filter = $filter('persona')
...@@ -69,5 +72,5 @@ class AccountManagement ...@@ -69,5 +72,5 @@ class AccountManagement
promise.$promise.then(successHandler, errorHandler) promise.$promise.then(successHandler, errorHandler)
angular.module('h.controllers.AccountManagement', []) angular.module('h.account', imports)
.controller('AccountManagement', AccountManagement) .controller('AccountController', AccountController)
...@@ -2,7 +2,7 @@ assert = chai.assert ...@@ -2,7 +2,7 @@ assert = chai.assert
sinon.assert.expose assert, prefix: null sinon.assert.expose assert, prefix: null
sandbox = sinon.sandbox.create() sandbox = sinon.sandbox.create()
describe 'h.controllers.AccountManagement', -> describe 'h.account.AccountController', ->
$scope = null $scope = null
fakeFlash = null fakeFlash = null
fakeSession = null fakeSession = null
...@@ -12,6 +12,8 @@ describe 'h.controllers.AccountManagement', -> ...@@ -12,6 +12,8 @@ describe 'h.controllers.AccountManagement', ->
disableUserPromise = null disableUserPromise = null
createController = null createController = null
beforeEach module('h.account')
beforeEach module ($provide, $filterProvider) -> beforeEach module ($provide, $filterProvider) ->
fakeSession = {} fakeSession = {}
fakeFlash = sandbox.spy() fakeFlash = sandbox.spy()
...@@ -29,8 +31,6 @@ describe 'h.controllers.AccountManagement', -> ...@@ -29,8 +31,6 @@ describe 'h.controllers.AccountManagement', ->
$provide.value 'formHelpers', fakeFormHelpers $provide.value 'formHelpers', fakeFormHelpers
return return
beforeEach module('h.controllers.AccountManagement')
beforeEach inject ($rootScope, $q, $controller) -> beforeEach inject ($rootScope, $q, $controller) ->
$scope = $rootScope.$new() $scope = $rootScope.$new()
$scope.persona = 'egon@columbia.edu' $scope.persona = 'egon@columbia.edu'
...@@ -41,7 +41,7 @@ describe 'h.controllers.AccountManagement', -> ...@@ -41,7 +41,7 @@ describe 'h.controllers.AccountManagement', ->
fakeSession.disable_user = sandbox.stub().returns($promise: disableUserPromise) fakeSession.disable_user = sandbox.stub().returns($promise: disableUserPromise)
createController = -> createController = ->
$controller('AccountManagement', {$scope: $scope}) $controller('AccountController', {$scope: $scope})
describe '.submit', -> describe '.submit', ->
createFakeForm = (overrides={}) -> 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