Skip to content

Commit

Permalink
Fix form build spec
Browse files Browse the repository at this point in the history
In Rails 8 the input helper for `<textarea>` HTML tag is finally
called `textarea` and not `text_area` anymore.
  • Loading branch information
tvdeyen committed Jan 5, 2025
1 parent fb04bb1 commit eed6ebd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec/libraries/forms/builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,16 @@
"Template",
controller: controller,
label: "<label>",
text_area: "<textarea>",
textarea: "<textarea>",
content_tag: "<alchemy-tinymce>"
)
end

subject { builder.richtext(attribute) }

it "uses a alchemy-tinymce" do
expect(template).to receive(:text_area).with(
receiving_method = (Rails::VERSION::MAJOR >= 8) ? :textarea : :text_area
expect(template).to receive(receiving_method).with(
"Ding",
:foo,
hash_including(
Expand Down

0 comments on commit eed6ebd

Please sign in to comment.