Sha256: fe962ca3fa665581da58d37b9f3c23b542b569c950977d9ad0563b5ac2d16e0c

Contents?: true

Size: 1.41 KB

Versions: 8

Compression:

Stored size: 1.41 KB

Contents

describe(rio.components.Radio, {
	beforeEach: function() {
		this.radio1 = rio.components.Radio.example("a1");
		this.radio2 = rio.components.Radio.example("a2");
		insertComponent(this.radio1);
		insertComponent(this.radio2);
	},
	
	"should have an html radio element": function() {
		this.radio1.html().childElements()[0].tagName.shouldEqual("INPUT");
		this.radio1.html().childElements()[0].type.shouldEqual("radio");
	},
	
	"should have the proper checked attribute": function() {
		this.radio1.html().childElements()[0].checked.shouldBeFalse();
		this.radio2.html().childElements()[0].checked.shouldBeTrue();
	},
	
	"should update the checked attribute when updating the html checkbox": function() {
		this.radio1.html().childElements()[0].simulate("click");
		this.radio1.getChecked().shouldBeTrue();
	},
	
	"should update the html checked attribute when update the checked attribute": function() {
		this.radio1.setChecked(true);
		this.radio1.html().childElements()[0].checked.shouldBeTrue();
	},

	"should update the other radio buttons html checked attributes when updating the checked attribute": function() {
		this.radio1.setChecked(true);
		this.radio2.html().childElements()[0].checked.shouldBeFalse();
	},

	"should update the other radio buttons checked attributes when updating the checked attribute": function() {
		this.radio1.html().childElements()[0].simulate("click");
		this.radio2.getChecked().shouldBeFalse();
	}
	

});

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
riojs-0.0.7 public/javascripts/specs/components/radio_spec.js
riojs-0.0.6 public/javascripts/specs/components/radio_spec.js
riojs-0.0.5 public/javascripts/specs/components/radio_spec.js
riojs-0.0.4 public/javascripts/specs/components/radio_spec.js
riojs-0.0.3 public/javascripts/specs/components/radio_spec.js
riojs-0.0.2 public/javascripts/specs/components/radio_spec.js
riojs-0.0.1 public/javascripts/specs/components/radio_spec.js
riojs-0.0.0 public/javascripts/specs/components/radio_spec.js