Sha256: 434870696c97574c7fbbfdb36597ee7e7ce0c267fc979fbfd64b4cc0a1a19da9

Contents?: true

Size: 1.48 KB

Versions: 20

Compression:

Stored size: 1.48 KB

Contents

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("<p>hello, world</p>")
  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(%{<!-- BEGIN (anonymous widget class) depth 0: :name => \"julia\" -->
<div>
  <p>hello, julia</p>
</div>
<!-- END (anonymous widget class) depth 0 -->})
  end

  it "should let you get rendered content back with .inline_html" do
    data = ::Fortitude::Widgets::Html5.inline_html do
      p "hello, world"
    end
    expect(data).to eq("<p>hello, world</p>")
  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(%{<!-- BEGIN (anonymous widget class) depth 0: :name => \"julia\" -->
<div>
  <p>hello, julia</p>
</div>
<!-- END (anonymous widget class) depth 0 -->})
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
fortitude-0.9.4-java spec/system/inline_system_spec.rb
fortitude-0.9.4 spec/system/inline_system_spec.rb
fortitude-0.9.3-java spec/system/inline_system_spec.rb
fortitude-0.9.3 spec/system/inline_system_spec.rb
fortitude-0.9.2-java spec/system/inline_system_spec.rb
fortitude-0.9.2 spec/system/inline_system_spec.rb
fortitude-0.9.1-java spec/system/inline_system_spec.rb
fortitude-0.9.1 spec/system/inline_system_spec.rb
fortitude-0.9.0-java spec/system/inline_system_spec.rb
fortitude-0.9.0 spec/system/inline_system_spec.rb
fortitude-0.0.10-java spec/system/inline_system_spec.rb
fortitude-0.0.10 spec/system/inline_system_spec.rb
fortitude-0.0.9-java spec/system/inline_system_spec.rb
fortitude-0.0.9 spec/system/inline_system_spec.rb
fortitude-0.0.7-java spec/system/inline_system_spec.rb
fortitude-0.0.7 spec/system/inline_system_spec.rb
fortitude-0.0.6-java spec/system/inline_system_spec.rb
fortitude-0.0.6 spec/system/inline_system_spec.rb
fortitude-0.0.5-java spec/system/inline_system_spec.rb
fortitude-0.0.5 spec/system/inline_system_spec.rb