1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00
sinatra/test/template_test.rb
Blake Mizerany becd6d8ab0 ERB in place
2008-02-20 22:57:05 -08:00

30 lines
641 B
Ruby

require File.dirname(__FILE__) + '/helper'
context "Templates (in general)" 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