Skip to content

Commit

Permalink
WIP rich_text_area spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Spone committed Mar 30, 2022
1 parent a308524 commit 9429dca
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/view_component/form/builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,25 @@

it_behaves_like "the default form builder", :submit
it_behaves_like "the default form builder", :text_area, :detail
if defined?(ActionView::Helpers::Tags::ActionText)
let(:object_klass) do
Class.new(ActiveRecord::Base) do
has_rich_text :content

class << self
def name
"Message"
end
end
end
end

let(:object) { object_klass.new }

context "with a model with rich text" do
it_behaves_like "the default form builder", :rich_text_area, :content
end
end
it_behaves_like "the default form builder", :text_field, :name
it_behaves_like "the default form builder", :time_field, :born_at
it_behaves_like "the default form builder", :time_select, :average_lap
Expand Down

0 comments on commit 9429dca

Please sign in to comment.