Add content_for and yield_content helpers <3. Thanks @RX14

This commit is contained in:
Sdogruyol 2016-07-09 19:54:35 +03:00
parent 73d6123f3d
commit 21b194a901
3 changed files with 17 additions and 23 deletions

View file

@ -36,12 +36,13 @@ describe "Views" do
end
it "renders layout with content_for" do
get "/view" do
name = "Kemal"
get "/view/:name" do |env|
name = env.params.url["name"]
render "spec/asset/hello_with_content_for.ecr", "spec/asset/layout_with_yield.ecr"
end
request = HTTP::Request.new("GET", "/view")
request = HTTP::Request.new("GET", "/view/world")
client_response = call_request_on_app(request)
client_response.body.should contain("<html>Hello world")
client_response.body.should contain("<h1>Hello from otherside</h1>")
end
end