Switch over to using sinon.sandbox in karma specs

This commit is contained in:
Blade Barringer
2015-06-20 14:48:38 -05:00
parent 970b8d4061
commit 944cef4d44
12 changed files with 44 additions and 59 deletions

View File

@@ -22,15 +22,12 @@ describe('Hall of Heroes Controller', function() {
});
it('populates contributor input with selected hero id', function(){
var loadHero = sinon.spy(scope, "loadHero");
var scrollTo = sinon.spy(window, "scrollTo");
var loadHero = sandbox.spy(scope, "loadHero");
var scrollTo = sandbox.spy(window, "scrollTo");
scope.populateContributorInput(user._id);
expect(scope._heroID).to.eql(user._id);
expect(loadHero.callCount).to.eql(1);
expect(scrollTo.callCount).to.eql(1);
scope.loadHero.restore();
window.scrollTo.restore();
});
});