changelog and test

This commit is contained in:
Eric Hochberger 2012-03-01 10:35:36 -05:00
parent a0ea7e4e0c
commit a1d8a72712
3 changed files with 15 additions and 3 deletions

View File

@ -1,5 +1,8 @@
## 2.0.1
### enhancements
* Add `:inline_label` configuration to nested booleans to display text inline with checkbox. ([@ehoch](https://github.com/ehoch))
### bug fix
* Sanitaze html attributes to `label` method. ([@nashby](https://github.com/nashby)).
Closes [#472](https://github.com/plataformatec/simple_form/issues/472)

View File

@ -29,12 +29,12 @@ GEM
erubis (2.7.0)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.1)
journey (1.0.3)
json (1.6.5)
metaclass (0.0.1)
mocha (0.10.3)
mocha (0.10.5)
metaclass (~> 0.0.1)
multi_json (1.0.4)
multi_json (1.1.0)
rack (1.4.1)
rack-cache (1.1)
rack (>= 0.4)

View File

@ -29,6 +29,13 @@ class BooleanInputTest < ActionView::TestCase
end
end
test 'input boolean with nested allows :inline_label' do
swap SimpleForm, :boolean_style => :nested do
with_input_for @user, :active, :boolean, :label => false, :inline_label => 'I am so inline.'
assert_select 'label.checkbox', :text => 'I am so inline.'
end
end
test 'input boolean with nested generates a manual hidden field for checkbox outside the label, to recreate Rails functionality with valid html5' do
swap SimpleForm, :boolean_style => :nested do
with_input_for @user, :active, :boolean
@ -98,4 +105,6 @@ class BooleanInputTest < ActionView::TestCase
end
end
end
end