From 7561a014da9edfa0685f0d577e028e9c335755d8 Mon Sep 17 00:00:00 2001 From: dfens Date: Mon, 29 Apr 2013 17:13:33 +0200 Subject: [PATCH] Setting custom field_error_proc test --- lib/simple_form.rb | 2 +- test/action_view_extensions/form_helper_test.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/simple_form.rb b/lib/simple_form.rb index 20e9db25..d559c174 100644 --- a/lib/simple_form.rb +++ b/lib/simple_form.rb @@ -139,7 +139,7 @@ module SimpleForm mattr_accessor :button_class @@button_class = 'button' - # Override the default ActiveRecordHelper behaviour of wrapping the input. + # Override the default ActiveModelHelper behaviour of wrapping the input. # This gets taken care of semantically by adding an error class to the wrapper tag # containing the input. mattr_accessor :field_error_proc diff --git a/test/action_view_extensions/form_helper_test.rb b/test/action_view_extensions/form_helper_test.rb index c9604d14..0acb2097 100644 --- a/test/action_view_extensions/form_helper_test.rb +++ b/test/action_view_extensions/form_helper_test.rb @@ -131,6 +131,13 @@ class FormHelperTest < ActionView::TestCase end end + test 'custom field error proc' do + expected_error_proc = lambda {} + swap SimpleForm, field_error_proc: expected_error_proc do + assert_equal expected_error_proc, SimpleForm.field_error_proc + end + end + private def swap_field_error_proc(expected_error_proc = lambda {})