Sha256: a90453b29189dc24bcf430784c5b891f04fd449f7f875cfa0eecd8e6e6e57d5c

Contents?: true

Size: 1016 Bytes

Versions: 1

Compression:

Stored size: 1016 Bytes

Contents

describe("SourceDocsView", function(){
	
	beforeEach(function(){
		var session = new Session();
		session.setAuthenticated('true');
		session.setApiKey('testtoken');
	    source = new Source();
	    source.set("source_id",'source_id');
		
		sinon.stub(jQuery,'ajax')
	
		this.sourceDocsView = new App.Views.SourceDocs({model : source});
	});
	
	afterEach(function(){
		var session = new Session();
		session.setAuthenticated('false');
		session.setApiKey(null);
		jQuery.ajax.restore();
	});
	
	it("should have render initial html",function(){
		this.sourceDocsSpy = sinon.spy(this.sourceDocsView,'render');
			
		this.sourceDocsView.render('source_id');
		expect(this.sourceDocsSpy).toHaveBeenCalledOnce();
	});
		
	it("should have correct html rendered ",function(){
		var title = this.sourceDocsView.el.innerHTML.search("Source attributes");
		expect(title).toBeGreaterThan(0);
		
		var title2 = this.sourceDocsView.el.innerHTML.search("Documents for app partition");
		expect(title2).toBeGreaterThan(0);	
	})
});

Version data entries

1 entries across 1 versions & 1 rubygems

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