Reworking the tests for the new app

This commit is contained in:
Will Marshall
2014-03-20 15:09:10 +11:00
parent 7f88b8eb39
commit dbc8e1bcf1
6 changed files with 81 additions and 39 deletions

View File

@@ -0,0 +1,24 @@
describe "SidebarCtrl", ->
ctrl = null
scope = null
location = null
beforeEach ->
module("Darkswarm")
location =
path: ->
"/test"
inject ($controller, $rootScope) ->
scope = $rootScope
ctrl = $controller 'SidebarCtrl', {$scope: scope, $location: location}
scope.$apply()
it 'tracks the active sidebar from the $location', ->
expect(scope.active_sidebar).toEqual "/test"
it 'is active when a location is set', ->
expect(scope.active()).toEqual "active"
it 'is inactive no location is set', ->
scope.active_sidebar = null
expect(scope.active()).toEqual null