require File.expand_path("spec_helper", File.dirname(File.dirname(__FILE__))) begin require 'tilt/erb' rescue LoadError warn "tilt not installed, skipping padrino_render plugin test" else describe "padrino_render plugin" do before do app(:bare) do plugin :padrino_render, :views=>"./spec/views" route do |r| r.is "partial" do partial("test", :locals=>{:title => "About Roda"}) end r.is "partial/subdir" do partial("about/test", :locals=>{:title => "About Roda"}) end r.is "partial/inline" do partial(:inline=>"Hello <%= name %>", :locals=>{:name => "Agent Smith"}) end r.is "render" do render(:content=>'bar', :layout_opts=>{:locals=>{:title=>"Home"}}) end r.is "render/nolayout" do render("about", :locals=>{:title => "No Layout"}, :layout=>nil) end end end end it "partial renders without layout, and prepends _ to template" do body("/partial").strip.should == "