Merge pull request #7826 from mfo/US/multiple-dropdown-with-comas

bug(multiple_drop_down_list): when their is a coma in label, comas is splitted as an item
This commit is contained in:
mfo 2022-10-02 11:05:54 +02:00 committed by GitHub
commit a545c1c58e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View file

@ -1,5 +1,4 @@
- if champ.to_s.present? - if !champ.blank?
%ul %ul
- champ.to_s.split(", ").each do |item| - champ.selected_options.each do |item|
%li %li= item
= item

View file

@ -0,0 +1,10 @@
describe 'views/shared/champs/multiple_drop_down_list/_show.html.haml', type: :view do
let(:champ) { build(:champ_multiple_drop_down_list, value: ['abc', '2, 3, 4']) }
subject { render partial: 'shared/champs/multiple_drop_down_list/show', locals: { champ: champ } }
it 'renders the view' do
subject
expect(rendered).to have_selector('li', count: champ.selected_options.size)
end
end