pantographe / view_component-form

Rails FormBuilder for ViewComponent
MIT License
206 stars 16 forks source link

rich_text_area spec #110

Open Spone opened 2 years ago

Spone commented 2 years ago

Close #77

3zrv commented 2 years ago

Thank you :)

Spone commented 2 years ago

@nicolas-brousse TL;DR:

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

nicolas-brousse commented 2 years ago

@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 commented 2 years ago

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

Spone commented 1 year ago

@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?