mirror of
https://github.com/heartcombo/simple_form.git
synced 2022-11-09 12:19:26 -05:00
Add tests to cover multiple attribute for grouped select in associations
Also, updates the CHANGELOG.md.
This commit is contained in:
parent
aae6f9b6fd
commit
7cbedde3de
3 changed files with 12 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
|||
* Allow custom error on forms without model. [@victorperez](https://github.com/victorperez)
|
||||
* Do not support Ruby < 2.3 anymore. [@gssbzn](https://github.com/gssbzn)
|
||||
* Add color input type. [@gssbzn](https://github.com/gssbzn)
|
||||
* Set multiple attribute for grouped selects also. [@ollym](https://github.com/ollym)
|
||||
|
||||
### Bug fix
|
||||
* Improve disabled option to input_field. [@betelgeuse](https://github.com/betelgeuse)
|
||||
|
|
|
@ -243,4 +243,10 @@ class AssociationTest < ActionView::TestCase
|
|||
assert_equal({ as: :check_boxes, collection_wrapper_tag: :ul, item_wrapper_tag: :li },
|
||||
options)
|
||||
end
|
||||
|
||||
test 'builder with group select considers multiple select by default' do
|
||||
with_association_for @user, :tags, as: :grouped_select, group_method: :group_method
|
||||
|
||||
assert_select 'select[multiple="multiple"].grouped_select'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -76,7 +76,11 @@ Friend = Struct.new(:id, :name) do
|
|||
end
|
||||
end
|
||||
|
||||
class Tag < Company; end
|
||||
class Tag < Company
|
||||
def group_method
|
||||
["category-1"]
|
||||
end
|
||||
end
|
||||
|
||||
TagGroup = Struct.new(:id, :name, :tags)
|
||||
|
||||
|
|
Loading…
Reference in a new issue