1 require File.dirname(__FILE__) + '/helper'
3 context "Layouts (in general)" do
6 Sinatra.application = nil
9 specify "can be inline" do
12 %Q{This is #{@content}!}
21 body.should.equal 'This is Blake!'
25 specify "can use named layouts" do
28 %Q{<h1>#{@content}</h1>}
32 render 'Foo', :layout => :pretty
40 body.should.equal '<h1>Foo</h1>'
43 body.should.equal 'Bar'
47 specify "can be read from a file if they're not inlined" do
50 @title = 'Welcome to the Hello Program'
51 render 'Blake', :layout => :foo_layout,
52 :views_directory => File.dirname(__FILE__) + "/views"
56 body.should.equal "Welcome to the Hello Program\nHi Blake\n"