Whitespaces
This commit is contained in:
parent
5da1254196
commit
619888ad5b
|
@ -40,7 +40,7 @@ module SimpleForm
|
|||
form_for(record, options, &block)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def css_class(record, html_options)
|
||||
if html_options.key?(:class)
|
||||
html_options[:class]
|
||||
|
|
|
@ -2,7 +2,7 @@ module SimpleForm
|
|||
module Helpers
|
||||
module HasErrors
|
||||
private
|
||||
|
||||
|
||||
def errors
|
||||
object.errors
|
||||
end
|
||||
|
@ -12,4 +12,4 @@ module SimpleForm
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -46,12 +46,12 @@ class FormHelperTest < ActionView::TestCase
|
|||
concat(simple_form_for(@user) do |f| end)
|
||||
assert_select 'form.simple_form.user'
|
||||
end
|
||||
|
||||
|
||||
test 'simple form should not add object class to form if css_class is specified' do
|
||||
concat(simple_form_for(:user, :html => {:class => nil}) do |f| end)
|
||||
assert_no_select 'form.user'
|
||||
end
|
||||
|
||||
|
||||
test 'simple form should add custom class to form if css_class is specified' do
|
||||
concat(simple_form_for(:user, :html => {:class => 'my_class'}) do |f| end)
|
||||
assert_select 'form.my_class'
|
||||
|
|
|
@ -14,8 +14,8 @@ class CustomizedInput < SimpleForm::Inputs::StringInput
|
|||
def input
|
||||
"<section>#{super}</section>".html_safe
|
||||
end
|
||||
|
||||
|
||||
def input_method
|
||||
:text_field
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -408,10 +408,10 @@ class FormBuilderTest < ActionView::TestCase
|
|||
assert_select 'form p input#user_name.string'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
test 'builder support no wrapping when wrapper is false' do
|
||||
with_form_for @user, :name, :wrapper => false
|
||||
assert_select 'form > label[for=user_name]'
|
||||
with_form_for @user, :name, :wrapper => false
|
||||
assert_select 'form > label[for=user_name]'
|
||||
assert_select 'form > input#user_name.string'
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue