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
relevance-castronaut-0.2.0 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.2.5 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.3.0 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.3.5 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.3.6 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.4.1 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.4.2 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.4.3 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.4.4 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.4.5 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.4.6 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.5.0 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.5.1 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.5.2 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.5.3 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.5.4 vendor/sinatra/test/template_test.rb
relevance-castronaut-0.6.0 vendor/sinatra/compat/template_test.rb
relevance-castronaut-0.6.1 vendor/sinatra/compat/template_test.rb
relevance-castronaut-0.7.4 vendor/sinatra/compat/template_test.rb
relevance-castronaut-0.7.5 vendor/sinatra/compat/template_test.rb