Skip to content

Commit 659633c

Browse files
committed
Use textarea in textarea specs only
Use a simple text field instead of the more complex textarea in specs that are not related to textarea. This will simplify the test suite and prevent unrelated failures Ref: #941
1 parent 6321a72 commit 659633c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/action_view/cases/test_form_for_helpers.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ def test_not_embed_authenticity_token_in_remote_forms
2929
::ActionView::Helpers::FormTagHelper.embed_authenticity_token_in_remote_forms = false
3030

3131
form_for(@post, validate: true, remote: true) do |f|
32-
concat f.text_area(:cost)
32+
concat f.text_field(:cost)
3333
end
3434

3535
validators = { 'post[cost]' => { presence: [{ message: I18n.t('errors.messages.blank') }] } }
3636
expected = whole_form_for('/posts', 'new_post', 'new_post', validators: validators, remote: true) do
37-
form_field('textarea', id: 'post_cost', name: 'post[cost]', tag_content: "\n")
37+
form_field('input', id: 'post_cost', name: 'post[cost]', type: 'text')
3838
end
3939

4040
assert_dom_equal expected, output_buffer
@@ -45,13 +45,13 @@ def test_not_embed_authenticity_token_in_remote_forms
4545

4646
def test_http_method
4747
form_for(@post, validate: true, method: :patch) do |f|
48-
concat f.text_area(:cost)
48+
concat f.text_field(:cost)
4949
end
5050

5151
validators = { 'post[cost]' => { presence: [{ message: I18n.t('errors.messages.blank') }] } }
5252
expected = whole_form_for('/posts', 'new_post', 'new_post', validators: validators) do
5353
form_field('input', name: '_method', type: 'hidden', value: 'patch') +
54-
form_field('textarea', id: 'post_cost', name: 'post[cost]', tag_content: "\n")
54+
form_field('input', id: 'post_cost', name: 'post[cost]', type: 'text')
5555
end
5656

5757
assert_dom_equal expected, output_buffer

0 commit comments

Comments
 (0)