From 960f9019fd4c545b8f45c6bbecddef8c08d719e7 Mon Sep 17 00:00:00 2001 From: Joshua Date: Mon, 1 Feb 2016 12:19:58 -0800 Subject: [PATCH] Fix E2E test with phantomJS CustomerDetail controller spec --- .../app/customers/customer-detail.controller.spec.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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;