Sha256: f0da93ef6acca1b35b81f4ea92c280b12c353109d05bac5ed02cf64499a92997

Contents?: true

Size: 810 Bytes

Versions: 30

Compression:

Stored size: 810 Bytes

Contents

require_relative "../spec_helper"

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

30 entries across 30 versions & 1 rubygems

Version Path
roda-3.28.0 spec/plugin/padrino_render_spec.rb
roda-3.27.0 spec/plugin/padrino_render_spec.rb
roda-3.26.0 spec/plugin/padrino_render_spec.rb
roda-3.25.0 spec/plugin/padrino_render_spec.rb
roda-3.24.0 spec/plugin/padrino_render_spec.rb
roda-3.23.0 spec/plugin/padrino_render_spec.rb
roda-3.22.0 spec/plugin/padrino_render_spec.rb
roda-3.21.0 spec/plugin/padrino_render_spec.rb
roda-3.20.0 spec/plugin/padrino_render_spec.rb
roda-3.19.0 spec/plugin/padrino_render_spec.rb
roda-3.18.0 spec/plugin/padrino_render_spec.rb
roda-3.17.0 spec/plugin/padrino_render_spec.rb
roda-3.16.0 spec/plugin/padrino_render_spec.rb
roda-3.15.0 spec/plugin/padrino_render_spec.rb
roda-3.14.1 spec/plugin/padrino_render_spec.rb
roda-3.14.0 spec/plugin/padrino_render_spec.rb
roda-3.13.0 spec/plugin/padrino_render_spec.rb
roda-3.12.0 spec/plugin/padrino_render_spec.rb
roda-3.11.0 spec/plugin/padrino_render_spec.rb
roda-3.10.0 spec/plugin/padrino_render_spec.rb