Sha256: 6cb891c588620731b7406b19ba40a50c383b47c84cf85a7004d812eacf54c76d

Contents?: true

Size: 1.16 KB

Versions: 5

Compression:

Stored size: 1.16 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
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fortitude-0.0.4-java spec/system/tag_return_value_system_spec.rb
fortitude-0.0.4 spec/system/tag_return_value_system_spec.rb
fortitude-0.0.3 spec/system/tag_return_value_system_spec.rb
fortitude-0.0.2 spec/system/tag_return_value_system_spec.rb
fortitude-0.0.1 spec/system/tag_return_value_system_spec.rb