No need a custom helper
This commit is contained in:
parent
9462f32ed6
commit
982419b073
|
@ -14,10 +14,6 @@ class ErrorTest < ActionView::TestCase
|
||||||
end
|
end
|
||||||
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
|
test 'error should not generate content for attribute without errors' do
|
||||||
with_error_for @user, :active
|
with_error_for @user, :active
|
||||||
assert_no_select 'span.error'
|
assert_no_select 'span.error'
|
||||||
|
@ -141,7 +137,7 @@ class ErrorTest < ActionView::TestCase
|
||||||
|
|
||||||
test 'input with custom error works' do
|
test 'input with custom error works' do
|
||||||
error_text = "Super User Name! can't be blank"
|
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}"
|
assert_select 'span.error', "#{error_text}"
|
||||||
end
|
end
|
||||||
|
@ -149,7 +145,7 @@ class ErrorTest < ActionView::TestCase
|
||||||
test 'input with custom error works when using full_error component' do
|
test 'input with custom error works when using full_error component' do
|
||||||
swap_wrapper :default, self.custom_wrapper_with_full_error do
|
swap_wrapper :default, self.custom_wrapper_with_full_error do
|
||||||
error_text = "Super User Name! can't be blank"
|
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}"
|
assert_select 'span.error', "#{error_text}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue