         expect(@stateManager._matchState 'foo bar').toBeFalsy()
 
   describe 'addStateManager', =>
-
     it 'creates a new StateManager', =>
       StateManager = Backbone.StateManager
       spy = spyOn(Backbone, 'StateManager').andCallThrough()

      expect(stateManager.addState).toHaveBeenCalledWith 'noTransitions', jasmine.any Object

  describe 'prototype', =>

    beforeEach => @stateManager = new Backbone.StateManager @states

    afterEach => delete @stateManager

    describe 'initialize', =>

      it 'calls triggerState on the first state found that has initial : true set on it', =>
        spyOn Backbone.StateManager.prototype, 'triggerState'


        expect(@stateManager.trigger).toHaveBeenCalledWith 'remove:state', 'noTransitions'

     describe 'getCurrentState', =>
      it 'returns the current state', =>
        @stateManager.currentState = @states.noTransitions
        expect(@stateManager.getCurrentState()).toEqual @states.noTransitions

    describe 'triggerState', =>
      beforeEach =>
        spyOn(@stateManager, '_matchState').andReturn true
        spyOn @stateManager, 'enterState'
