Added test for full_errors_on_association bugfix

This commit is contained in:
Michaël Van Damme 2014-09-29 19:50:01 +02:00
parent e8041f73e6
commit 879c4d03a6
1 changed files with 8 additions and 0 deletions

View File

@ -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