Skip to content

Commit 399757b

Browse files
committed
Tests to prove it works
1 parent b86e80f commit 399757b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎test/bootstrap_form_test.rb‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,22 @@ def warn(message, ...)
10611061
assert_equivalent_html expected, namespaced_form_for.errors_on(:email)
10621062
assert_equivalent_html expected, namespaced_form_with.errors_on(:email)
10631063
end
1064+
1065+
test "bootstrap_form_with uses class: argument not in html arguments" do
1066+
expected = <<~HTML
1067+
<form accept-charset="UTF-8" action="/users" method="post" class="custom-class">
1068+
</form>
1069+
HTML
1070+
assert_equivalent_html expected, bootstrap_form_with(model: @user, class: "custom-class") { |_f| nil }
1071+
end
1072+
1073+
test "bootstrap_form_with uses id: argument not in html arguments" do
1074+
expected = <<~HTML
1075+
<form accept-charset="UTF-8" action="/users" method="post" id="custom-id">
1076+
</form>
1077+
HTML
1078+
assert_equivalent_html expected, bootstrap_form_with(scope: :user, url: "/users", id: "custom-id") { |_f| nil }
1079+
end
10641080
end
10651081

10661082
class LegacyBootstrapFormTest < ActionView::TestCase

0 commit comments

Comments
 (0)