No need a custom helper

This commit is contained in:
Rafael Mendonça França 2014-04-03 17:43:03 -03:00
parent 9462f32ed6
commit 982419b073
1 changed files with 2 additions and 6 deletions

View File

@ -14,10 +14,6 @@ class ErrorTest < ActionView::TestCase
end
end
def with_custom_error_for(object, *args)
with_form_for(object, *args)
end
test 'error should not generate content for attribute without errors' do
with_error_for @user, :active
assert_no_select 'span.error'
@ -141,7 +137,7 @@ class ErrorTest < ActionView::TestCase
test 'input with custom error works' do
error_text = "Super User Name! can't be blank"
with_custom_error_for(@user, :name, error: error_text)
with_form_for @user, :name, error: error_text
assert_select 'span.error', "#{error_text}"
end
@ -149,7 +145,7 @@ class ErrorTest < ActionView::TestCase
test 'input with custom error works when using full_error component' do
swap_wrapper :default, self.custom_wrapper_with_full_error do
error_text = "Super User Name! can't be blank"
with_custom_error_for(@user, :name, error: error_text)
with_form_for @user, :name, error: error_text
assert_select 'span.error', "#{error_text}"
end