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