describe "Fortitude inline-code support", :type => :system do it "should let you get a widget class back with .new_subclass" do wc = widget_class new_wc = wc.inline_subclass do p "hello, world" end expect(render(new_wc)).to eq("
hello, world
") end it "should let you pass assigns to the new subclass, and inherit settings of the parent" do wc = widget_class do start_and_end_comments true format_output true needs :name end new_wc = wc.inline_subclass do div { p "hello, #{name}" } end expect(render(new_wc.new(:name => 'julia'))).to eq(%{hello, julia
hello, world
") end it "should let you pass assigns to the new widget with .inline_html, and inherit settings of the parent" do wc = widget_class do start_and_end_comments true format_output true needs :name end content = wc.inline_html(:name => 'julia') do div { p "hello, #{name}" } end expect(content).to eq(%{hello, julia