Introduce Kemal::InitHandler to initialize HTTP::Server::Context with defaults

This commit is contained in:
Sdogruyol 2016-07-17 18:11:26 +03:00
parent 725e051723
commit 09d9e708f1
10 changed files with 48 additions and 40 deletions

View file

@ -1,15 +1,6 @@
require "./spec_helper"
describe "Context" do
it "has a default content type" do
get "/" do |env|
"Hello"
end
request = HTTP::Request.new("GET", "/")
client_response = call_request_on_app(request)
client_response.headers["Content-Type"].should eq("text/html")
end
it "sets content type" do
get "/" do |env|
env.response.content_type = "application/json"