Whitespaces

This commit is contained in:
Rafael Mendonça França 2011-09-08 10:28:28 -03:00
parent 5da1254196
commit 619888ad5b
5 changed files with 10 additions and 10 deletions

View File

@ -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]

View File

@ -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

View File

@ -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'

View File

@ -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

View File

@ -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