Skip to content

Commit

Permalink
add test to ensure that html options in collection work with grouped …
Browse files Browse the repository at this point in the history
…select
  • Loading branch information
nashby committed Aug 1, 2013
1 parent 87323fd commit 73005f4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/inputs/grouped_collection_select_input_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,17 @@ class GroupedCollectionSelectInputTest < ActionView::TestCase
end
end
end

test 'grouped collection should accept html options as the last element of collection' do
with_input_for @user, :tag_ids, :grouped_select,
collection: [['Authors', [['Jose', 'jose', class: 'foo'], ['Carlos', 'carlos', class: 'bar']]]],
group_method: :last

assert_select 'select.grouped_select#user_tag_ids' do
assert_select 'optgroup[label=Authors]' do
assert_select 'option.foo', 'Jose'
assert_select 'option.bar', 'Carlos'
end
end
end
end

0 comments on commit 73005f4

Please sign in to comment.