Sha256: 7af782c079b70dbb8fcb5010128f7d00b669249b3e4d332a292965061b007d9c

Contents?: true

Size: 906 Bytes

Versions: 1

Compression:

Stored size: 906 Bytes

Contents

describe("DocView", function(){
	
	beforeEach(function(){
		var session = new Session();
		session.setAuthenticated('true');
		session.setApiKey('testtoken');
		
	    doc = new Doc();
	    doc.set("dbkey",'testkey');
	
		sinon.stub(doc,'get_doc')
	
		this.docView = new App.Views.Doc({model : doc});
	});
	
	afterEach(function(){
		var session = new Session();
		session.setAuthenticated('false');
		session.setApiKey(null);
	});
	
	it("should have render initial html",function(){
		this.docRenderSpy = sinon.spy(this.docView,'render');
			
		this.docView.render();
		expect(this.docRenderSpy).toHaveBeenCalledOnce();
	});
	
	it("should have correct html rendered ",function(){
		var title = this.docView.el.innerHTML.search('[testkey]');
		expect(title).toBeGreaterThan(0);
		
		var change_btn = this.docView.el.innerHTML.search('Upload Token string');
		expect(change_btn).toBeGreaterThan(0);
		
	})
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rhoconnect-3.2.0.beta1 spec/javascripts/doc_view_spec.js