Sha256: 8aaa182a1671cb8da6d3bf15721edab794de782dc7ade374baa2a85c5568fa6c

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

describe("ShowDeviceView", function(){
	
	beforeEach(function(){
		var session = new Session();
		session.setAuthenticated('true');
		session.setApiKey('testtoken');
	    client = new Client();
		client.set('device_id', 'testdeviceid');
		client.set('user_id', 'user_id');
	
		sinon.stub(jQuery,'ajax')
	
		this.setdeviceView = new App.Views.ShowDevice({model : client});
	});
	
	afterEach(function(){
		var session = new Session();
		session.setAuthenticated('false');
		session.setApiKey(null);
		jQuery.ajax.restore();
	});
	
	it("should have render initial html",function(){
		this.setDeviceSpy = sinon.spy(this.setdeviceView,'render');
			
		this.setdeviceView.render();
		expect(this.setDeviceSpy).toHaveBeenCalledOnce();
	});
	
	it("should delete device",function(){
		this.setDeviceDeleteSpy = sinon.spy(this.setdeviceView,'delete_device');
			
		this.setdeviceView.delete_device();
		expect(this.setDeviceDeleteSpy).toHaveBeenCalledOnce();
	});
	
	it("should have correct html rendered ",function(){
		var title = this.setdeviceView.el.innerHTML.search("Device: testdeviceid");
		expect(title).toBeGreaterThan(0);	
	})
});

Version data entries

1 entries across 1 versions & 1 rubygems

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