Add layout support for render macro. It should be improved in the future.

This commit is contained in:
Fatih Kadir Akın 2015-12-09 17:52:56 +02:00
parent a67a8508cf
commit 9ade49ae20
3 changed files with 17 additions and 1 deletions

View file

@ -10,4 +10,14 @@ describe "Views" do
response = kemal.call(request)
response.body.should contain("Hello world")
end
it "renders layout" do
kemal = Kemal::Handler.new
kemal.add_route "GET", "/view/:name" do |env|
render "spec/asset/hello.ecr", "spec/asset/layout.ecr"
end
request = HTTP::Request.new("GET", "/view/world")
response = kemal.call(request)
response.body.should contain("<html>Hello world")
end
end