Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use textarea in textarea specs only #943

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/action_view/cases/test_form_for_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ def test_not_embed_authenticity_token_in_remote_forms
::ActionView::Helpers::FormTagHelper.embed_authenticity_token_in_remote_forms = false

form_for(@post, validate: true, remote: true) do |f|
concat f.text_area(:cost)
concat f.text_field(:cost)
end

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

assert_dom_equal expected, output_buffer
Expand All @@ -45,13 +45,13 @@ def test_not_embed_authenticity_token_in_remote_forms

def test_http_method
form_for(@post, validate: true, method: :patch) do |f|
concat f.text_area(:cost)
concat f.text_field(:cost)
end

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

assert_dom_equal expected, output_buffer
Expand Down
Loading