Sha256: ff42f5d513107de38fa086cd9cb6e2c3b1c525273cf8d446cd312c0ea9462c80

Contents?: true

Size: 854 Bytes

Versions: 28

Compression:

Stored size: 854 Bytes

Contents

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 "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 "render uses layout by default" do
    body("/render").strip.must_equal "<title>Roda: Home</title>\nbar"
  end

  it "render doesn't use layout if layout is nil" do
    body("/render/nolayout").strip.must_equal "<h1>No Layout</h1>"
  end
end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
roda-2.29.0 spec/plugin/padrino_render_spec.rb
roda-2.28.0 spec/plugin/padrino_render_spec.rb
roda-2.27.0 spec/plugin/padrino_render_spec.rb
roda-2.26.0 spec/plugin/padrino_render_spec.rb
roda-2.25.0 spec/plugin/padrino_render_spec.rb
roda-2.24.0 spec/plugin/padrino_render_spec.rb
roda-2.23.0 spec/plugin/padrino_render_spec.rb
roda-2.22.0 spec/plugin/padrino_render_spec.rb
roda-2.21.0 spec/plugin/padrino_render_spec.rb
roda-2.20.0 spec/plugin/padrino_render_spec.rb
roda-2.19.0 spec/plugin/padrino_render_spec.rb
roda-2.18.0 spec/plugin/padrino_render_spec.rb
roda-2.17.0 spec/plugin/padrino_render_spec.rb
roda-2.16.0 spec/plugin/padrino_render_spec.rb
roda-2.15.0 spec/plugin/padrino_render_spec.rb
roda-2.14.0 spec/plugin/padrino_render_spec.rb
roda-2.13.0 spec/plugin/padrino_render_spec.rb
roda-2.12.0 spec/plugin/padrino_render_spec.rb
roda-2.11.0 spec/plugin/padrino_render_spec.rb
roda-2.10.0 spec/plugin/padrino_render_spec.rb