1
0
Fork 0
mirror of https://github.com/heartcombo/simple_form.git synced 2022-11-09 12:19:26 -05:00

Revert "Ensure generated components are html safe."

This reverts commit 3dbdb0a86f.
This commit is contained in:
José Valim 2010-01-10 05:25:16 +01:00
parent 3dbdb0a86f
commit 81fe28c717
5 changed files with 1 additions and 27 deletions

View file

@ -30,9 +30,7 @@ module SimpleForm
# component is invalid it will be skipped.
def call
return @component.call unless valid?
safe_content = content.html_safe! + @component.call
safe_content.html_safe! if safe_content.respond_to?(:html_safe!)
safe_content
content + @component.call
end
def valid?

View file

@ -33,12 +33,6 @@ class ErrorTest < ActionView::TestCase
end
end
test 'error should be html safe' do
with_error_for @user, :name, :string do |error|
assert error.call.html_safe?
end
end
test 'error should generate messages for attribute with single error' do
with_error_for @user, :name, :string
assert_select 'span.error', "can't be blank"

View file

@ -27,12 +27,6 @@ class HintTest < ActionView::TestCase
end
end
test 'hint should be html safe' do
with_hint_for @user, :name, :string, :hint => 'Use with care...' do |hint|
assert hint.call.html_safe?
end
end
test 'hint should be generated with input text' do
with_hint_for @user, :name, :string, :hint => 'Use with care...'
assert_select 'span.hint', 'Use with care...'

View file

@ -19,12 +19,6 @@ class InputTest < ActionView::TestCase
end
end
test 'input should be html safe' do
with_input_for @user, :name, :string do |input|
assert input.call.html_safe?
end
end
test 'input should map text field to string attribute' do
with_input_for @user, :name, :string
assert_select 'input[name=\'user[name]\'][id=user_name][value=New in Simple Form!]'

View file

@ -19,12 +19,6 @@ class LabelTest < ActionView::TestCase
end
end
test 'label should be html safe' do
with_label_for @user, :name, :string do |label|
assert label.call.html_safe?
end
end
test 'label should not be generated for hidden inputs' do
with_label_for @user, :name, :hidden do |label|
assert label.call.blank?