mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Fix content rendering
This commit is contained in:
parent
59720fbd16
commit
d6dc893052
2 changed files with 19 additions and 13 deletions
|
@ -22,7 +22,7 @@ describe "Views" do
|
|||
end
|
||||
request = HTTP::Request.new("GET", "/view/world")
|
||||
client_response = call_request_on_app(request)
|
||||
client_response.body.should contain("Hello world")
|
||||
client_response.body.strip.should eq("<html>Hello world\n</html>")
|
||||
end
|
||||
|
||||
it "renders layout" do
|
||||
|
@ -59,4 +59,14 @@ describe "Views" do
|
|||
client_response.body.should contain("Hello world")
|
||||
client_response.body.should contain("<h1>Hello from otherside</h1>")
|
||||
end
|
||||
|
||||
it "does not render content_for that was not yielded" do
|
||||
get "/view/:name" do |env|
|
||||
name = env.params.url["name"]
|
||||
render "#{__DIR__}/asset/hello_with_content_for.ecr", "#{__DIR__}/asset/layout.ecr"
|
||||
end
|
||||
request = HTTP::Request.new("GET", "/view/world")
|
||||
client_response = call_request_on_app(request)
|
||||
client_response.body.should_not contain("<h1>Hello from otherside</h1>")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue