From 879c4d03a64e55dffa04a01c609dfe269abf0311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Damme?= Date: Mon, 29 Sep 2014 19:50:01 +0200 Subject: [PATCH] Added test for full_errors_on_association bugfix --- test/form_builder/error_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/form_builder/error_test.rb b/test/form_builder/error_test.rb index f529540a..92e4ef43 100644 --- a/test/form_builder/error_test.rb +++ b/test/form_builder/error_test.rb @@ -133,6 +133,14 @@ class ErrorTest < ActionView::TestCase end end + test 'full error finds errors on association with reflection' do + swap_wrapper :default, self.custom_wrapper_with_full_error do + with_form_for @user, :company_id, as: :select, + reflection: Association.new(Company, :company, {}) + assert_select 'span.error', 'Company must be valid' + end + end + test 'full error can be disabled' do swap_wrapper :default, self.custom_wrapper_with_full_error do with_form_for @user, :company_id, as: :select, full_error: false