Sha256: 4e1588ef3fcfb2ca9908f50ab086919225ecc01117c6f26df17b512462ea78af

Contents?: true

Size: 594 Bytes

Versions: 90

Compression:

Stored size: 594 Bytes

Contents

require File.dirname(__FILE__) + '/helper'

context "Templates" do

  specify "are read from files if Symbols" do

    get '/from_file' do
      @name = 'Alena'
      erb :foo, :views_directory => File.dirname(__FILE__) + "/views"
    end

    get_it '/from_file'

    body.should.equal 'You rock Alena!'

  end

  specify "use layout.ext by default if available" do

    get '/layout_from_file' do
      erb :foo, :views_directory => File.dirname(__FILE__) + "/views/layout_test"
    end

    get_it '/layout_from_file'
    should.be.ok
    body.should.equal "x This is foo! x \n"

  end

end

Version data entries

90 entries across 90 versions & 14 rubygems

Version Path
sinatra-0.9.0 compat/template_test.rb
sinatra-0.9.0.2 compat/template_test.rb
sinatra-0.9.0.3 compat/template_test.rb
sinatra-0.9.1 compat/template_test.rb
sinatra-0.9.1.1 compat/template_test.rb
sinatra-0.9.0.1 compat/template_test.rb
sinatra-0.3.3 test/template_test.rb
sinatra-0.3.2 test/template_test.rb
sinatra-0.9.0.4 compat/template_test.rb
sinatra-0.9.2 compat/template_test.rb