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
nbudin-castronaut-0.7.5 vendor/sinatra/compat/template_test.rb
sinatra-0.9.6 compat/template_test.rb
sinatra-0.9.5 compat/template_test.rb
akamai_bookmarklet-0.1.2 vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/template_test.rb
middleman-0.13.1 lib/middleman/vendor/gems/ruby/1.9.1/gems/sinatra-0.9.4/compat/template_test.rb
akamai_bookmarklet-0.1.1 vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/template_test.rb
akamai_bookmarklet-0.1.0 vendor/gems/ruby/1.8/gems/sinatra-0.9.4/compat/template_test.rb
middleman-0.12.2 lib/middleman/vendor/gems/gems/sinatra-0.9.4/compat/template_test.rb
middleman-0.12.1 lib/middleman/vendor/gems/gems/sinatra-0.9.4/compat/template_test.rb
middleman-0.12.0.pre3 lib/middleman/vendor/gems/gems/sinatra-0.9.4/compat/template_test.rb
middleman-0.12.0.pre2 lib/middleman/vendor/gems/gems/sinatra-0.9.4/compat/template_test.rb
middleman-0.12.0.pre lib/middleman/vendor/gems/gems/sinatra-0.9.4/compat/template_test.rb
middleman-0.10.17 vendor/gems/gems/sinatra-0.9.4/compat/template_test.rb
middleman-0.10.16 vendor/gems/gems/sinatra-0.9.4/compat/template_test.rb
middleman-0.10.15 vendor/gems/gems/sinatra-0.9.4/compat/template_test.rb
middleman-0.10.14 vendor/gems/gems/sinatra-0.9.4/compat/template_test.rb
sinatra-0.9.4 compat/template_test.rb
sinatra-0.3.1 test/template_test.rb
sinatra-0.9.0.5 compat/template_test.rb
sinatra-0.3.0 test/template_test.rb