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
3mix-castronaut-0.5.0.2 vendor/sinatra/test/template_test.rb
Syd-sinatra-0.3.2 test/template_test.rb
Syd-sinatra-0.9.0.2 compat/template_test.rb
Syd-sinatra-0.9.0.4 compat/template_test.rb
adamwiggins-sinatra-0.8.9 compat/template_test.rb
bmizerany-sinatra-0.3.2 test/template_test.rb
bmizerany-sinatra-0.8.10 compat/template_test.rb
bmizerany-sinatra-0.8.9 compat/template_test.rb
bmizerany-sinatra-0.9.0.2 compat/template_test.rb
bmizerany-sinatra-0.9.0.4 compat/template_test.rb
bmizerany-sinatra-0.9.0.5 compat/template_test.rb
bmizerany-sinatra-0.9.0 compat/template_test.rb
bmizerany-sinatra-0.9.1 compat/template_test.rb
darkhelmet-sinatra-0.9.0.5 compat/template_test.rb
darkhelmet-sinatra-0.9.1.1 compat/template_test.rb
darkhelmet-sinatra-0.9.1 compat/template_test.rb
masover-castronaut-0.4.4.4 vendor/sinatra/test/template_test.rb
masover-castronaut-0.4.4.5 vendor/sinatra/test/template_test.rb
masover-castronaut-0.5.0.1 vendor/sinatra/test/template_test.rb
p8-castronaut-0.6.1.1 vendor/sinatra/compat/template_test.rb