Created
January 9, 2015 15:15
-
-
Save deyceg/f38adfbfdb91021d087e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Load module and configure providers | |
beforeEach(module("factfind", function($provide) { | |
$provide.value("customer", { | |
getPersonalDetails: sinon.stub(), | |
getRetirementDetails: sinon.stub(), | |
setPersonalDetails: sinon.spy(), | |
setRetirementDetails: sinon.spy() | |
}); | |
$provide.value("engine", {}) | |
})); | |
//Setup common stuff | |
beforeEach(inject(function($rootScope, $controller, _customer_, _engine_, $q) { | |
scope = $rootScope.$new(); | |
customer = _customer_; | |
engine = _engine_; | |
//Mock the engine | |
engine.getStatePensionDate = function(){ | |
var defer = $q.defer(); | |
defer.resolve(null); //This is parameterised | |
return defer.promise; | |
}; | |
ctrl = $controller('AboutFormCtrl', { | |
$scope: scope, | |
customer: customer, | |
engine: engine | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment