Files
openfoodnetwork/spec/javascripts/unit/darkswarm/controllers/sidebar_controller_spec.js.coffee
2014-03-27 13:01:05 +11:00

23 lines
527 B
CoffeeScript

describe "SidebarCtrl", ->
ctrl = null
scope = null
location = null
beforeEach ->
module("Darkswarm")
location =
path: ->
"/login"
inject ($controller, $rootScope) ->
scope = $rootScope
ctrl = $controller 'SidebarCtrl', {$scope: scope, $location: location}
scope.$apply()
it 'is active when a location is set', ->
expect(scope.active()).toEqual true
it 'is inactive no location is set', ->
location.path = ->
null
expect(scope.active()).toEqual false