Sha256: 9df1c25ff8d6bb9e664c6e47fbf2e2a4bde62ed4634b448aa7ec1fc390597c8c
Contents?: true
Size: 1.13 KB
Versions: 28
Compression:
Stored size: 1.13 KB
Contents
require File.expand_path("spec_helper", File.dirname(File.dirname(__FILE__))) begin require 'tilt/erb' rescue LoadError warn "tilt not installed, skipping partials plugin test" else describe "partials plugin" do before do app(:bare) do plugin :partials, :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 end end end it "partial renders without layout, and prepends _ to template" do body("/partial").strip.must_equal "<h1>About Roda</h1>" end it "partial renders without layout, and prepends _ to template" do body("/partial/subdir").strip.must_equal "<h1>Subdir: About Roda</h1>" end it "partial handles inline partials" do body("/partial/inline").strip.must_equal "Hello Agent Smith" end end end
Version data entries
28 entries across 28 versions & 1 rubygems