Sha256: 88664de04b16db676fcf8ab21fe0d7c1fdfae90b9bc30d0149b98ca24a9ab210
Contents?: true
Size: 1.16 KB
Versions: 1
Compression:
Stored size: 1.16 KB
Contents
describe("EditUserView", function(){ beforeEach(function(){ var session = new Session(); session.setAuthenticated('true'); session.setApiKey('testtoken'); this.editUserView = new App.Views.EditUser(); }); afterEach(function(){ var session = new Session(); session.setAuthenticated('false'); session.setApiKey(null); }); it("should have render initial html",function(){ this.UserRenderSpy = sinon.spy(this.editUserView,'render'); this.editUserView.render(); expect(this.UserRenderSpy).toHaveBeenCalledOnce(); }); it("should call edit",function(){ this.editUserRenderSpy = sinon.spy(this.editUserView,'edit'); sinon.stub(jQuery,'ajax').yieldsTo("success"); function myevent(){ this.preventDefault=function(){return true;} } e = new myevent(); this.editUserView.edit(e); expect(this.editUserRenderSpy).toHaveBeenCalledOnce(); jQuery.ajax.restore(); }); it("should have correct html rendered ",function(){ var title = this.editUserView.el.innerHTML.search('Edit admin'); expect(title).toBeGreaterThan(0); var password = this.editUserView.el.innerHTML.search('Password'); expect(password).toBeGreaterThan(0); }) });
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rhoconnect-3.2.0.beta1 | spec/javascripts/edit_user_view_spec.js |