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 6a99e6a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/libraries/forms/builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,17 @@
"Template",
controller: controller,
label: "<label>",
text_area: "<textarea>",
textarea: "<textarea>",
text_area: "<textarea>", # need to support Rails 7
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 6a99e6a

Please sign in to comment.