Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieujobin committed Oct 31, 2023
1 parent a55015f commit 59335db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/dynamic_form_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,9 @@ def test_default_form_builder_with_dynamic_form_helpers
concat f.error_messages
end

autocomplete = ActionView.version.to_s >= '6.1.0' ? ' autocomplete="off"' : ''
expected = %(<form class="new_post" id="new_post" action="" accept-charset="UTF-8" method="post">) +
%(<input name="utf8" type="hidden" value="&#x2713;" autocomplete="off"/>) +
%(<input name="utf8" type="hidden" value="&#x2713;"#{autocomplete} />) +
%(<div class="formError">can't be empty</div>) +
%(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>) +
%(</form>)
Expand All @@ -379,7 +380,7 @@ def test_default_form_builder_no_instance_variable
concat f.error_messages
end

autocomplete = ActionView.version >= '6.1.0' ? ' autocomplete="off"' : ''
autocomplete = ActionView.version.to_s >= '6.1.0' ? ' autocomplete="off"' : ''
expected = %(<form accept-charset="UTF-8" class="new_post" method="post" action="" id="new_post">) +
%(<input name="utf8" type="hidden" value="&#x2713;"#{autocomplete} />) +
%(<div class="formError">can't be empty</div>) +
Expand Down

0 comments on commit 59335db

Please sign in to comment.