'use strict';

describe('Service: Errordispatcher', function () {

  // load the service's module
  beforeEach(module('sumaAnalysis'));

  // instantiate service
  var Errordispatcher;
  beforeEach(inject(function (_errorDispatcher_) {
    Errordispatcher = _errorDispatcher_;
  }));

  it('should do something', function () {
    expect(!!Errordispatcher).to.be(true);
  });

});

@@ -176,17 +176,75 @@
 spatcher
-;
+,%0A      Rootscope,%0A      Uistates,%0A      data,%0A      stub;%0A
 %0A  befor
@@ -283,16 +283,42 @@
 patcher_
+, _uiStates_, _$rootScope_
 ) %7B%0A    
@@ -360,96 +360,615 @@
 ;%0A  
-%7D));%0A%0A  it('should do something', function () %7B%0A    expect(!!Errordispatcher).to.be(true
+  Rootscope = _$rootScope_,%0A    Uistates = _uiStates_;%0A%0A    data = %7Bmessage: 'Hello', code: 401%7D;%0A%0A    stub = sinon.stub(Uistates, 'setUIState');%0A    stub.returns(true);%0A  %7D));%0A%0A  it('should update state via Uistates', function () %7B%0A    Errordispatcher.dispatch(data, Rootscope);%0A%0A    expect(Uistates.setUIState).to.be.calledOnce();%0A%0A    stub.restore();%0A  %7D);%0A%0A  it('should attach error message and code to scope', function () %7B%0A    Errordispatcher.dispatch(data, Rootscope);%0A%0A    expect(Rootscope.errorMessage).to.equal(data.message);%0A    expect(Rootscope.errorCode).to.equal(data.code);%0A%0A    stub.restore(
 );%0A 

update errorDispatcher tests