Skip to content

rich_text_area spec#110

Draft
Spone wants to merge 5 commits into
mainfrom
rich-text-area-form-builder-spec
Draft

rich_text_area spec#110
Spone wants to merge 5 commits into
mainfrom
rich-text-area-form-builder-spec

Conversation

@Spone

@Spone Spone commented Feb 23, 2022

Copy link
Copy Markdown
Collaborator

Close #77

@3zrv 3zrv left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but why?

@3zrv

3zrv commented Mar 20, 2022

Copy link
Copy Markdown

Thank you :)

@Spone Spone force-pushed the rich-text-area-form-builder-spec branch from ad3014c to d833a20 Compare March 20, 2022 14:17
@Spone Spone force-pushed the rich-text-area-form-builder-spec branch from d833a20 to 9429dca Compare March 30, 2022 20:30
@Spone

Spone commented Mar 30, 2022

Copy link
Copy Markdown
Collaborator Author

@nicolas-brousse TL;DR:

  • tests pass without ActionText
  • about 50+ failures with ActionText: ActiveRecord::StatementInvalid: Could not find table 'messages'

What do you think? Is there a way to add fixtures?

@nicolas-brousse

Copy link
Copy Markdown
Member

@Spone I think by adding a table in schema.rb may do the job.

https://github.com/pantographe/view_component-form/blob/main/spec/internal/db/schema.rb

@Spone

Spone commented Mar 30, 2022

Copy link
Copy Markdown
Collaborator Author

@nicolas-brousse yes, it fixes the ActiveRecord::StatementInvalid exception, but there are still NoMethodError exceptions.

@Spone Spone requested a review from nicolas-brousse May 1, 2023 22:20
@Spone

Spone commented May 1, 2023

Copy link
Copy Markdown
Collaborator Author

@nicolas-brousse I spent more time on this. The only remaining failure in tests is:

Failures:

  1) ViewComponent::Form::Builder with a model with rich text behaves like the default form builder when calling #rich_text_area 
     Failure/Error: self.class.tag_klass.new(object_name, method_name, @view_context, options).render
     
     NoMethodError:
       undefined method `rich_text_area_tag' for #<ActionView::Base:0x000055a48935d008 @_config=#< {}>, @lookup_context=#<ActionView::LookupContext:0x000055a48935d490 @details_key=nil, @digest_cache=nil, @cache=true, @prefixes=[], @details={:locale=>[:en], :formats=>[:html, :text, :js, :css, :ics, :csv, :vcf, :vtt, :png, :jpeg, :gif, :bmp, :tiff, :svg, :mpeg, :mp3, :ogg, :m4a, :webm, :mp4, :otf, :ttf, :woff, :woff2, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :pdf, :zip, :gzip], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby]}, @view_paths=#<ActionView::PathSet:0x000055a48935d198 @paths=[#<ActionView::FileSystemResolver:0x000055a4877d7770 @unbound_templates=#<Concurrent::Map:0x000055a4877d7748 entries=0 default_proc=nil>, @path_parser=#<ActionView::Resolver::PathParser:0x000055a488580700>, @path="/home/hans/.asdf/installs/ruby/3.0.6/lib/ruby/gems/3.0.0/gems/actiontext-7.0.4.3/app/views">, #<ActionView::FileSystemResolver:0x000055a4877e0050 @unbound_templates=#<Concurrent::Map:0x000055a4877d7f68 entries=0 default_proc=nil>, @path_parser=#<ActionView::Resolver::PathParser:0x000055a488580638>, @path="/home/hans/.asdf/installs/ruby/3.0.6/lib/ruby/gems/3.0.0/gems/view_component-3.0.0/app/views">]>>, @view_renderer=#<ActionView::Renderer:0x000055a48935cf40 @lookup_context=#<ActionView::LookupContext:0x000055a48935d490 @details_key=nil, @digest_cache=nil, @cache=true, @prefixes=[], @details={:locale=>[:en], :formats=>[:html, :text, :js, :css, :ics, :csv, :vcf, :vtt, :png, :jpeg, :gif, :bmp, :tiff, :svg, :mpeg, :mp3, :ogg, :m4a, :webm, :mp4, :otf, :ttf, :woff, :woff2, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :pdf, :zip, :gzip], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby]}, @view_paths=#<ActionView::PathSet:0x000055a48935d198 @paths=[#<ActionView::FileSystemResolver:0x000055a4877d7770 @unbound_templates=#<Concurrent::Map:0x000055a4877d7748 entries=0 default_proc=nil>, @path_parser=#<ActionView::Resolver::PathParser:0x000055a488580700>, @path="/home/hans/.asdf/installs/ruby/3.0.6/lib/ruby/gems/3.0.0/gems/actiontext-7.0.4.3/app/views">, #<ActionView::FileSystemResolver:0x000055a4877e0050 @unbound_templates=#<Concurrent::Map:0x000055a4877d7f68 entries=0 default_proc=nil>, @path_parser=#<ActionView::Resolver::PathParser:0x000055a488580638>, @path="/home/hans/.asdf/installs/ruby/3.0.6/lib/ruby/gems/3.0.0/gems/view_component-3.0.0/app/views">]>>>, @current_template=nil, @_assigns={}, @_controller=#<ApplicationController:0x00000000008958>, @_request=nil, @_default_form_builder=nil, @view_flow=#<ActionView::OutputFlow:0x000055a48935ce00 @content={}>, @output_buffer=nil, @virtual_path=nil>
       Did you mean?  rich_text_area

Any idea?

@Spone Spone moved this to In progress / Pending Review in Open Source Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix rich_text_area spec in Builder spec

3 participants