diff --git a/src/client/app/customers/customer-detail.controller.spec.js b/src/client/app/customers/customer-detail.controller.spec.js index 2f09be13..acdc6f40 100644 --- a/src/client/app/customers/customer-detail.controller.spec.js +++ b/src/client/app/customers/customer-detail.controller.spec.js @@ -12,8 +12,10 @@ describe('app.customers', function() { beforeEach(function() { sinon.stub(dataservice, 'getCustomer') - .returns($q.when(mockData.blackWidow)) - .withArgs(id); + .withArgs(id) + .returns($q.when(mockData.blackWidow)); + + $stateParams.id = id; controller = $controller('CustomerDetail'); $rootScope.$apply(); }); @@ -27,9 +29,6 @@ describe('app.customers', function() { describe('after activate', function() { describe('should have called dataservice.getCustomer', function() { - beforeEach(function() { - $stateParams.id = id; - }); it('1 time', function() { expect(dataservice.getCustomer).to.have.been.calledOnce;