mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
commit
2ffb4dccdf
6 changed files with 73 additions and 1 deletions
1
spec/asset/hello.ecr
Normal file
1
spec/asset/hello.ecr
Normal file
|
@ -0,0 +1 @@
|
|||
Hello <%= env.params["name"] %>
|
13
spec/view_spec.cr
Normal file
13
spec/view_spec.cr
Normal file
|
@ -0,0 +1,13 @@
|
|||
require "./spec_helper"
|
||||
|
||||
describe "Views" do
|
||||
it "renders file" do
|
||||
kemal = Kemal::Handler.new
|
||||
kemal.add_route "GET", "/view/:name" do |env|
|
||||
render "spec/asset/hello.ecr"
|
||||
end
|
||||
request = HTTP::Request.new("GET", "/view/world")
|
||||
response = kemal.call(request)
|
||||
response.body.should contain("Hello world")
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue