Sha256: 7470a3b3ee699d031afa3f3d0780449a4d9dc0cb7675764106dd6c4216741fd9
Contents?: true
Size: 1 KB
Versions: 6
Compression:
Stored size: 1 KB
Contents
describe("Home", function(){ beforeEach(function(){ var session = new Session(); session.setAuthenticated('true'); session.setApiKey('testtoken'); source = new Source(); sinon.stub(source,'fetch') sinon.stub(source,'save'); confirmStub = sinon.stub(window, 'confirm'); confirmStub.returns(true); this.homeView = new App.Views.Home({model : source}); }); afterEach(function(){ var session = new Session(); session.setAuthenticated('false'); session.setApiKey(null); confirmStub.restore(); }); it("should have render initial html",function(){ this.indexRenderSpy = sinon.spy(this.homeView,'render'); this.homeView.render(); expect(this.indexRenderSpy).toHaveBeenCalledOnce(); }); it("should have correct html rendered ",function(){ var change_btn = this.homeView.el.innerHTML.search('App partition sources'); expect(change_btn).toBeGreaterThan(0); var reset = this.homeView.el.innerHTML.search('Sync Server URL'); expect(reset).toBeGreaterThan(0); }) });
Version data entries
6 entries across 6 versions & 1 rubygems