@@ -456,13 +456,12 @@ class BootstrapFormTest < ActionView::TestCase
456456 end
457457
458458 test "label error messages use humanized attribute names" do
459- begin
460- I18n . backend . store_translations ( :en , activerecord : { attributes : { user : { email : "Your e-mail address" } } } )
459+ I18n . backend . store_translations ( :en , activerecord : { attributes : { user : { email : "Your e-mail address" } } } )
461460
462- @user . email = nil
463- assert @user . invalid?
461+ @user . email = nil
462+ assert @user . invalid?
464463
465- expected = <<-HTML . strip_heredoc
464+ expected = <<-HTML . strip_heredoc
466465 < form accept-charset ="UTF-8 " action ="/users " class ="new_user " id ="new_user " method ="post " role ="form ">
467466 #{ '<input name="utf8" type="hidden" value="✓"/>' unless ::Rails ::VERSION ::STRING >= '6' }
468467 < div class ="form-group ">
@@ -471,11 +470,10 @@ class BootstrapFormTest < ActionView::TestCase
471470 < div class ="invalid-feedback "> can't be blank, is too short (minimum is 5 characters)</ div >
472471 </ div >
473472 </ form>
474- HTML
475- assert_equivalent_xml expected , bootstrap_form_for ( @user , label_errors : true , inline_errors : true ) { |f | f . text_field :email }
476- ensure
477- I18n . backend . store_translations ( :en , activerecord : { attributes : { user : { email : nil } } } )
478- end
473+ HTML
474+ assert_equivalent_xml expected , bootstrap_form_for ( @user , label_errors : true , inline_errors : true ) { |f | f . text_field :email }
475+ ensure
476+ I18n . backend . store_translations ( :en , activerecord : { attributes : { user : { email : nil } } } )
479477 end
480478
481479 test "alert message is wrapped correctly" do
@@ -759,14 +757,13 @@ class BootstrapFormTest < ActionView::TestCase
759757 end
760758
761759 test "help translations do not escape HTML when _html is appended to the name" do
762- begin
763- I18n . backend . store_translations ( :en , activerecord : { help : { user : { email_html : "This is <strong>useful</strong> help" } } } )
760+ I18n . backend . store_translations ( :en , activerecord : { help : { user : { email_html : "This is <strong>useful</strong> help" } } } )
764761
765- output = bootstrap_form_for ( @user ) do |f |
766- f . text_field ( :email )
767- end
762+ output = bootstrap_form_for ( @user ) do |f |
763+ f . text_field ( :email )
764+ end
768765
769- expected = <<-HTML . strip_heredoc
766+ expected = <<-HTML . strip_heredoc
770767 < form accept-charset ="UTF-8 " action ="/users " class ="new_user " id ="new_user " method ="post " role ="form ">
771768 #{ '<input name="utf8" type="hidden" value="✓"/>' unless ::Rails ::VERSION ::STRING >= '6' }
772769 < div class ="form-group ">
@@ -775,11 +772,10 @@ class BootstrapFormTest < ActionView::TestCase
775772 < small class ="form-text text-muted "> This is < strong > useful</ strong > help</ small >
776773 </ div >
777774 </ form>
778- HTML
779- assert_equivalent_xml expected , output
780- ensure
781- I18n . backend . store_translations ( :en , activerecord : { help : { user : { email_html : nil } } } )
782- end
775+ HTML
776+ assert_equivalent_xml expected , output
777+ ensure
778+ I18n . backend . store_translations ( :en , activerecord : { help : { user : { email_html : nil } } } )
783779 end
784780
785781 test "allows the form object to be nil" do
0 commit comments