Sha256: ca06b7b7ee7bce15e9167dfdcfcf65a805f6dcd8fbf04a6592a6cf10943e37aa

Contents?: true

Size: 1.37 KB

Versions: 24

Compression:

Stored size: 1.37 KB

Contents

describe "Fortitude tag return values", :type => :system do
  context "should blow up when calling a method on" do
    def expect_nrv(name, &block)
      e = capture_exception(Fortitude::Errors::NoReturnValueFromTag) { render(widget_class_with_content(&block)) }
      expect(e).to be
      expect(e.method_name).to eq(name)
    end

    it "a simple tag" do
      expect_nrv(:foo) { p.foo }
    end

    it "a tag with attributes" do
      expect_nrv(:foo) { p(:foo => :bar).foo }
    end

    it "a tag with direct content" do
      expect_nrv(:foo) { p("whatever").foo }
    end

    it "a tag with a block" do
      expect_nrv(:foo) { p { text "whatever" }.foo }
    end

    it "a tag with a block and direct content" do
      expect_nrv(:foo) { p("foo") { text "whatever" }.foo }
    end

    it "a tag with direct content and attributes" do
      expect_nrv(:foo) { p("foo", :foo => :bar).foo }
    end

    it "a tag with a block and attributes" do
      expect_nrv(:foo) { p(:foo => :bar) { text "whatever" }.foo }
    end

    it "a tag with a block, direct content, and attributes" do
      expect_nrv(:foo) { p("foo", :foo => :bar) { text "whatever" }.foo }
    end
  end

  context "should not blow up when calling" do
    it "#is_a?" do
      wc = widget_class_with_content { text("value: #{p.is_a?(String).inspect}") }
      expect(render(wc)).to eq("<p></p>value: false")
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
fortitude-0.9.6-java spec/system/tag_return_value_system_spec.rb
fortitude-0.9.6 spec/system/tag_return_value_system_spec.rb
fortitude-0.9.5-java spec/system/tag_return_value_system_spec.rb
fortitude-0.9.5 spec/system/tag_return_value_system_spec.rb
fortitude-0.9.4-java spec/system/tag_return_value_system_spec.rb
fortitude-0.9.4 spec/system/tag_return_value_system_spec.rb
fortitude-0.9.3-java spec/system/tag_return_value_system_spec.rb
fortitude-0.9.3 spec/system/tag_return_value_system_spec.rb
fortitude-0.9.2-java spec/system/tag_return_value_system_spec.rb
fortitude-0.9.2 spec/system/tag_return_value_system_spec.rb
fortitude-0.9.1-java spec/system/tag_return_value_system_spec.rb
fortitude-0.9.1 spec/system/tag_return_value_system_spec.rb
fortitude-0.9.0-java spec/system/tag_return_value_system_spec.rb
fortitude-0.9.0 spec/system/tag_return_value_system_spec.rb
fortitude-0.0.10-java spec/system/tag_return_value_system_spec.rb
fortitude-0.0.10 spec/system/tag_return_value_system_spec.rb
fortitude-0.0.9-java spec/system/tag_return_value_system_spec.rb
fortitude-0.0.9 spec/system/tag_return_value_system_spec.rb
fortitude-0.0.7-java spec/system/tag_return_value_system_spec.rb
fortitude-0.0.7 spec/system/tag_return_value_system_spec.rb