Test with label_input too
This commit is contained in:
parent
51bdd20246
commit
93161d7eb3
|
@ -231,4 +231,15 @@ class WrapperTest < ActionView::TestCase
|
|||
|
||||
assert_select "div.custom_wrapper label.string.inline-class"
|
||||
end
|
||||
|
||||
test 'label_input accepts attributes in the DSL' do
|
||||
swap_wrapper :default, self.custom_wrapper_with_label_input_class do
|
||||
with_concat_form_for @user do |f|
|
||||
concat f.input :name
|
||||
end
|
||||
end
|
||||
|
||||
assert_select "div.custom_wrapper label.string.inline-class"
|
||||
assert_select "div.custom_wrapper input.string.inline-class"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -82,6 +82,12 @@ module MiscHelpers
|
|||
end
|
||||
end
|
||||
|
||||
def custom_wrapper_with_label_input_class
|
||||
SimpleForm.build tag: :div, class: "custom_wrapper" do |b|
|
||||
b.use :label_input, class: 'inline-class'
|
||||
end
|
||||
end
|
||||
|
||||
def custom_wrapper_with_wrapped_input
|
||||
SimpleForm.build tag: :div, class: "custom_wrapper" do |b|
|
||||
b.wrapper tag: :div, class: 'elem' do |component|
|
||||
|
|
Loading…
Reference in New Issue