Skip to content

Commit 9196dd0

Browse files
committed
Rubocop auto update
1 parent baa0cdf commit 9196dd0

File tree

2 files changed

+20
-24
lines changed

2 files changed

+20
-24
lines changed

test/bootstrap_configuration_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ class BootstrapConfigurationTest < ActionView::TestCase
1818
config = BootstrapForm::Configuration.new
1919
config.default_form_attributes = nil
2020

21-
assert_equal({ }, config.default_form_attributes)
21+
assert_equal({}, config.default_form_attributes)
2222
end
2323

2424
test "does not allow to set default_form_attributes with unsupported value" do
2525
config = BootstrapForm::Configuration.new
2626

2727
exception = assert_raises ArgumentError do
28-
config.default_form_attributes = [1,2,3]
28+
config.default_form_attributes = [1, 2, 3]
2929
end
30-
assert_equal('Unsupported default_form_attributes [1, 2, 3]', exception.message)
30+
assert_equal("Unsupported default_form_attributes [1, 2, 3]", exception.message)
3131
end
3232
end

test/bootstrap_form_test.rb

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -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="&#x2713;"/>' 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="&#x2713;"/>' 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

Comments
 (0)