Skip to content

Commit 38c964a

Browse files
committed
added missing test for disabled inline check_boxes
1 parent 07ecebd commit 38c964a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/bootstrap_checkbox_test.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ def setup
3737
assert_equal expected, @builder.check_box(:terms, label: 'I agree to the terms', inline: true)
3838
end
3939

40+
test "disabled inline check_box" do
41+
expected = %{<label class="checkbox-inline disabled" for="user_terms"><input disabled="disabled" name="user[terms]" type="hidden" value="0" /><input disabled="disabled" id="user_terms" name="user[terms]" type="checkbox" value="1" /> I agree to the terms</label>}
42+
assert_equal expected, @builder.check_box(:terms, label: 'I agree to the terms', inline: true, disabled: true)
43+
end
44+
4045
test 'collection_check_boxes renders the form_group correctly' do
4146
collection = [Address.new(id: 1, street: 'Foobar')]
4247
expected = %{<input id="user_misc" multiple="multiple" name="user[misc][]" type="hidden" value="" /><div class="form-group"><label class="control-label" for="user_misc">This is a checkbox collection</label><div class="checkbox"><label for="user_misc_1"><input id="user_misc_1" name="user[misc][]" type="checkbox" value="1" /> Foobar</label></div><span class="help-block">With a help!</span></div>}

0 commit comments

Comments
 (0)