Ensure wrap_with without a tag works.
This commit is contained in:
parent
6a763baafd
commit
b9a568d149
|
@ -16,6 +16,7 @@ module SimpleForm
|
||||||
@namespace = namespace
|
@namespace = namespace
|
||||||
@components = components
|
@components = components
|
||||||
@defaults = defaults
|
@defaults = defaults
|
||||||
|
@defaults[:tag] = :div unless @defaults.key?(:tag)
|
||||||
@defaults[:class] = Array.wrap(@defaults[:class])
|
@defaults[:class] = Array.wrap(@defaults[:class])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ class HintTest < ActionView::TestCase
|
||||||
test 'hint with custom wrappers works' do
|
test 'hint with custom wrappers works' do
|
||||||
swap_wrapper do
|
swap_wrapper do
|
||||||
with_hint_for @user, :name, :hint => "can't be blank"
|
with_hint_for @user, :name, :hint => "can't be blank"
|
||||||
assert_select 'span.omg_hint', "can't be blank"
|
assert_select 'div.omg_hint', "can't be blank"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -84,7 +84,7 @@ class WrapperTest < ActionView::TestCase
|
||||||
assert_select "section.custom_wrapper div.another_wrapper input.string"
|
assert_select "section.custom_wrapper div.another_wrapper input.string"
|
||||||
assert_no_select "section.custom_wrapper div.another_wrapper span.omg_error"
|
assert_no_select "section.custom_wrapper div.another_wrapper span.omg_error"
|
||||||
assert_select "section.custom_wrapper div.error_wrapper span.omg_error"
|
assert_select "section.custom_wrapper div.error_wrapper span.omg_error"
|
||||||
assert_select "section.custom_wrapper > span.omg_hint", "cool"
|
assert_select "section.custom_wrapper > div.omg_hint", "cool"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ module MiscHelpers
|
||||||
b.wrapper :error_wrapper, :tag => :div, :class => "error_wrapper" do |be|
|
b.wrapper :error_wrapper, :tag => :div, :class => "error_wrapper" do |be|
|
||||||
be.use :error, :wrap_with => { :tag => :span, :class => "omg_error" }
|
be.use :error, :wrap_with => { :tag => :span, :class => "omg_error" }
|
||||||
end
|
end
|
||||||
b.use :hint, :wrap_with => { :tag => :span, :class => "omg_hint" }
|
b.use :hint, :wrap_with => { :class => "omg_hint" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue